Commit 4700b5a5 authored by Paul Eggert's avatar Paul Eggert
Browse files

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

* process.c (create_process) [!DOS_NT]:
Remove now-unnecessary calls to emacs_close.
parent 2ce3c565
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>
* w32term.c (x_draw_hollow_cursor): Delete the brush object when
......
......@@ -1346,21 +1346,13 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
}
#ifndef MSDOS
emacs_close (0);
emacs_close (1);
emacs_close (2);
/* Redirect file descriptors and clear FD_CLOEXEC on the redirected ones. */
/* Redirect file descriptors and clear the close-on-exec flag on the
redirected ones. IN, OUT, and ERR are close-on-exec so they
need not be closed explicitly. */
dup2 (in, 0);
dup2 (out, 1);
dup2 (err, 2);
emacs_close (in);
if (out != in)
emacs_close (out);
if (err != in && err != out)
emacs_close (err);
setpgid (0, 0);
tcsetpgrp (0, pid);
......@@ -1386,7 +1378,8 @@ child_setup (int in, int out, int err, char **new_argv, bool set_pgrp,
#ifndef WINDOWSNT
/* 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
relocate_fd (int fd, int minfd)
{
......@@ -1400,7 +1393,9 @@ relocate_fd (int fd, int minfd)
emacs_perror ("while setting up child");
_exit (EXIT_CANCELED);
}
#ifdef MSDOS
emacs_close (fd);
#endif
return new;
}
}
......
......@@ -1831,7 +1831,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
pid = child_setup (xforkin, xforkout, xforkout,
new_argv, 1, encoded_current_dir);
#else /* not WINDOWSNT */
emacs_close (wait_child_setup[0]);
child_setup (xforkin, xforkout, xforkout,
new_argv, 1, encoded_current_dir);
#endif /* not WINDOWSNT */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment