Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
41bed37d
Commit
41bed37d
authored
Jul 18, 2011
by
Paul Eggert
Browse files
* alloc.c (valid_pointer_p): Use pipe, not open.
This fixes some permissions issues when debugging.
parent
3948a513
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
src/ChangeLog
src/ChangeLog
+3
-0
src/alloc.c
src/alloc.c
+5
-5
No files found.
src/ChangeLog
View file @
41bed37d
2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (valid_pointer_p): Use pipe, not open.
This fixes some permissions issues when debugging.
* fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
If fchown fails to set both uid and gid, try to set just gid,
as that is sometimes allowed. Adjust the file's mode to eliminate
...
...
src/alloc.c
View file @
41bed37d
...
...
@@ -4415,18 +4415,18 @@ valid_pointer_p (void *p)
#ifdef WINDOWSNT
return w32_valid_pointer_p (p, 16);
#else
int
fd
;
int fd
[2]
;
/* Obviously, we cannot just access it (we would SEGV trying), so we
trick the o/s to tell us whether p is a valid pointer.
Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may
not validate p in that case. */
if
(
(
fd
=
emacs_open
(
"__Valid__Lisp__Object__"
,
O_CREAT
|
O_WRONLY
|
O_TRUNC
,
0666
)
)
>
=
0
)
if (
pipe (fd
)
=
= 0)
{
int
valid
=
(
emacs_write
(
fd
,
(
char
*
)
p
,
16
)
==
16
);
emacs_close
(
fd
);
unlink
(
"__Valid__Lisp__Object__"
);
int valid = (emacs_write (fd
[1]
, (char *)
p, 16) == 16);
emacs_close (fd
[1]
);
emacs_close (fd[0]
);
return valid;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment