aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2011-07-19 13:33:28 -0700
committerPaul Eggert2011-07-19 13:33:28 -0700
commit0d8de0fd0a5a63cc9558b5c99f9c7f1ddcaf338a (patch)
tree31cf6b0a22ba1ee37fef321a296eb288828dc4c6 /src/alloc.c
parentc2216f8e3a2a17ba5b843f0329ce52c920a336b2 (diff)
parent590bd46743151a55ba68a7d211f82b2485c57d3a (diff)
downloademacs-0d8de0fd0a5a63cc9558b5c99f9c7f1ddcaf338a.tar.gz
emacs-0d8de0fd0a5a63cc9558b5c99f9c7f1ddcaf338a.zip
Merge from trunk.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 5848e797b4b..eb0185a8e35 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4430,18 +4430,18 @@ valid_pointer_p (void *p)
4430#ifdef WINDOWSNT 4430#ifdef WINDOWSNT
4431 return w32_valid_pointer_p (p, 16); 4431 return w32_valid_pointer_p (p, 16);
4432#else 4432#else
4433 int fd; 4433 int fd[2];
4434 4434
4435 /* Obviously, we cannot just access it (we would SEGV trying), so we 4435 /* Obviously, we cannot just access it (we would SEGV trying), so we
4436 trick the o/s to tell us whether p is a valid pointer. 4436 trick the o/s to tell us whether p is a valid pointer.
4437 Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may 4437 Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may
4438 not validate p in that case. */ 4438 not validate p in that case. */
4439 4439
4440 if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) 4440 if (pipe (fd) == 0)
4441 { 4441 {
4442 int valid = (emacs_write (fd, (char *)p, 16) == 16); 4442 int valid = (emacs_write (fd[1], (char *) p, 16) == 16);
4443 emacs_close (fd); 4443 emacs_close (fd[1]);
4444 unlink ("__Valid__Lisp__Object__"); 4444 emacs_close (fd[0]);
4445 return valid; 4445 return valid;
4446 } 4446 }
4447 4447