#include "systime.h"
#include "sysproc.h"
+#include "sysdir.h"
#include "sysfile.h" /* Always include after sysproc.h */
+#include "sysdir.h"
#include "syssignal.h" /* Always include before systty.h */
#include "systty.h"
The program's input comes from file INFILE (nil means `/dev/null').
Insert output in BUFFER before point; t means current buffer;
nil for BUFFER means discard it; 0 means discard and don't wait.
+If BUFFER is a string, then find or create a buffer with that name,
+then insert the output in that buffer, before point.
BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.
|| ZEROP (buffer)))
{
Lisp_Object spec_buffer = buffer;
- buffer = Fget_buffer (buffer);
+ buffer = Fget_buffer_create (buffer);
/* Mention the buffer name for a better error message. */
if (NILP (buffer))
CHECK_BUFFER (spec_buffer);
}
#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 ();
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);
}