X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fcallproc.c;h=8272ca99517fe73c5acacf113416331347afc9f3;hp=5c90e9e0f3ab401adfd5af15906b01e2a3708263;hb=0a57cba46779af884cc537d18923dcb6313b9904;hpb=de7caee5f47b0888cb3895ce8c09d745f2fc35aa diff --git a/src/callproc.c b/src/callproc.c index 5c90e9e..8272ca9 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -399,9 +399,6 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you } #endif } - /* Close STDERR into the parent process. We no longer need it. */ - if (fd_error >= 0) - close (fd_error); #else /* not WIN32_NATIVE */ pid = fork (); @@ -420,17 +417,18 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you child_setup (filefd, fd1, fd_error, new_argv, (char *) XSTRING_DATA (current_dir)); } - if (fd_error >= 0) - close (fd_error); - #endif /* not WIN32_NATIVE */ environ = save_environ; + /* Close STDERR into the parent process. We no longer need it. */ + if (fd_error >= 0) + close (fd_error); + /* Close most of our fd's, but not fd[0] since we will use that to read input from. */ close (filefd); - if (fd1 >= 0) + if ((fd1 >= 0) && (fd1 != fd_error)) close (fd1); }