1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-18 18:05:07 +00:00

* callproc.c (child_setup, relocate_fd) [!DOS_NT]:

* process.c (create_process) [!DOS_NT]:
Remove now-unnecessary calls to emacs_close.
This commit is contained in:
Paul Eggert 2013-07-13 17:30:45 -07:00
parent 2ce3c56586
commit 4700b5a52d
3 changed files with 13 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2013-07-14 Paul Eggert <eggert@cs.ucla.edu>
* callproc.c (child_setup, relocate_fd) [!DOS_NT]:
* process.c (create_process) [!DOS_NT]:
Remove now-unnecessary calls to emacs_close.
2013-07-13 Eli Zaretskii <eliz@gnu.org> 2013-07-13 Eli Zaretskii <eliz@gnu.org>
* w32term.c (x_draw_hollow_cursor): Delete the brush object when * w32term.c (x_draw_hollow_cursor): Delete the brush object when

View File

@ -1346,21 +1346,13 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
} }
#ifndef MSDOS #ifndef MSDOS
emacs_close (0); /* Redirect file descriptors and clear the close-on-exec flag on the
emacs_close (1); redirected ones. IN, OUT, and ERR are close-on-exec so they
emacs_close (2); need not be closed explicitly. */
/* Redirect file descriptors and clear FD_CLOEXEC on the redirected ones. */
dup2 (in, 0); dup2 (in, 0);
dup2 (out, 1); dup2 (out, 1);
dup2 (err, 2); dup2 (err, 2);
emacs_close (in);
if (out != in)
emacs_close (out);
if (err != in && err != out)
emacs_close (err);
setpgid (0, 0); setpgid (0, 0);
tcsetpgrp (0, pid); tcsetpgrp (0, pid);
@ -1386,7 +1378,8 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
#ifndef WINDOWSNT #ifndef WINDOWSNT
/* Move the file descriptor FD so that its number is not less than MINFD. /* Move the file descriptor FD so that its number is not less than MINFD.
If the file descriptor is moved at all, the original is freed. */ If the file descriptor is moved at all, the original is closed on MSDOS,
but not elsewhere as the caller will close it anyway. */
static int static int
relocate_fd (int fd, int minfd) relocate_fd (int fd, int minfd)
{ {
@ -1400,7 +1393,9 @@ relocate_fd (int fd, int minfd)
emacs_perror ("while setting up child"); emacs_perror ("while setting up child");
_exit (EXIT_CANCELED); _exit (EXIT_CANCELED);
} }
#ifdef MSDOS
emacs_close (fd); emacs_close (fd);
#endif
return new; return new;
} }
} }

View File

@ -1831,7 +1831,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
pid = child_setup (xforkin, xforkout, xforkout, pid = child_setup (xforkin, xforkout, xforkout,
new_argv, 1, encoded_current_dir); new_argv, 1, encoded_current_dir);
#else /* not WINDOWSNT */ #else /* not WINDOWSNT */
emacs_close (wait_child_setup[0]);
child_setup (xforkin, xforkout, xforkout, child_setup (xforkin, xforkout, xforkout,
new_argv, 1, encoded_current_dir); new_argv, 1, encoded_current_dir);
#endif /* not WINDOWSNT */ #endif /* not WINDOWSNT */