summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-06 20:02:39 +0000
committerMiles Bader <miles@gnu.org>1996-07-06 20:02:39 +0000
commita2c07245c0e68d19f7c2d2b86fd542c78420d458 (patch)
treed758e12cb6e98427e0da18045ebae8f37bbc3838
parentd6f1ad4983c6c6a324eff0516d8336a98989cdb5 (diff)
downloademacs-a2c07245c0e68d19f7c2d2b86fd542c78420d458.tar.gz
(Fcall_process) [MSDOS]:
Initialize fd[0]; unlink `tempfile' in case of errors. Make the `tempfile' parameter passed to `report_file_error' be a Lisp string. (Fcall_process): When fd_error is negative, don't close fd[0] if it's same as filefd. If stderr is redirected to NULL_DEVICE, make `report_file_error' print the name of device. Make the arguments a cons cell.
-rw-r--r--src/callproc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 58d8e8714f7..dc0c945925c 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -350,10 +350,12 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
if (outfilefd < 0)
{
close (filefd);
- report_file_error ("Opening process output file", Fcons (tempfile, Qnil));
+ report_file_error ("Opening process output file",
+ Fcons (build_string (tempfile), Qnil));
}
+ fd[0] = filefd;
fd[1] = outfilefd;
-#endif
+#endif /* MSDOS */
if (INTEGERP (buffer))
fd[1] = open (NULL_DEVICE, O_WRONLY), fd[0] = -1;
@@ -404,10 +406,17 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
if (fd_error < 0)
{
close (filefd);
- close (fd[0]);
+ if (fd[0] != filefd)
+ close (fd[0]);
if (fd1 >= 0)
close (fd1);
- report_file_error ("Cannot open", error_file);
+#ifdef MSDOS
+ unlink (tempfile);
+#endif
+ report_file_error ("Cannot redirect stderr",
+ Fcons ((NILP (error_file)
+ ? build_string (NULL_DEVICE) : error_file),
+ Qnil));
}
#ifdef MSDOS /* MW, July 1993 */
/* ??? Someone who knows MSDOG needs to check whether this properly