aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2011-07-18 23:10:15 -0700
committerPaul Eggert2011-07-18 23:10:15 -0700
commit7403ff044d82d390bdc4cdd3954448daedcd4571 (patch)
tree2f5ce508e4b20d5641ebd6c86ca61bc8dab401cc /src/alloc.c
parentd3411f89d34bd1009cae738f917abf477be09882 (diff)
parent15e3a074a6ebdcefd828a1ba14a5a12ff9921034 (diff)
downloademacs-7403ff044d82d390bdc4cdd3954448daedcd4571.tar.gz
emacs-7403ff044d82d390bdc4cdd3954448daedcd4571.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