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
cf237e27
Commit
cf237e27
authored
Jul 11, 2010
by
Andreas Schwab
Browse files
* callproc.c (relocate_fd): Use F_DUPFD if defined.
parent
a8fe7202
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
src/ChangeLog
src/ChangeLog
+2
-0
src/callproc.c
src/callproc.c
+10
-4
No files found.
src/ChangeLog
View file @
cf237e27
2010-07-11 Andreas Schwab <schwab@linux-m68k.org>
* callproc.c (relocate_fd): Use F_DUPFD if defined.
* alloc.c (pending_malloc_warning, malloc_warning): Add const.
* callproc.c (relocate_fd, getenv_internal_1, getenv_internal)
(egetenv): Likewise.
...
...
src/callproc.c
View file @
cf237e27
...
...
@@ -1288,7 +1288,16 @@ relocate_fd (int fd, int minfd)
return
fd
;
else
{
int
new
=
dup
(
fd
);
int
new
;
#ifdef F_DUPFD
new
=
fcntl
(
fd
,
F_DUPFD
,
minfd
);
#else
new
=
dup
(
fd
);
if
(
new
!=
-
1
)
/* Note that we hold the original FD open while we recurse,
to guarantee we'll get a new FD if we need it. */
new
=
relocate_fd
(
new
,
minfd
);
#endif
if
(
new
==
-
1
)
{
const
char
*
message1
=
"Error while setting up child: "
;
...
...
@@ -1299,9 +1308,6 @@ relocate_fd (int fd, int minfd)
emacs_write
(
2
,
message2
,
strlen
(
message2
));
_exit
(
1
);
}
/* Note that we hold the original FD open while we recurse,
to guarantee we'll get a new FD if we need it. */
new
=
relocate_fd
(
new
,
minfd
);
emacs_close
(
fd
);
return
new
;
}
...
...
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