Mercurial > emacs
comparison src/callproc.c @ 15610:b43e16d8ab5b
(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.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 06 Jul 1996 20:02:39 +0000 |
parents | cdf40972804f |
children | 11517dc55f5b |
comparison
equal
deleted
inserted
replaced
15609:036ab27f7ea8 | 15610:b43e16d8ab5b |
---|---|
348 | 348 |
349 outfilefd = creat (tempfile, S_IREAD | S_IWRITE); | 349 outfilefd = creat (tempfile, S_IREAD | S_IWRITE); |
350 if (outfilefd < 0) | 350 if (outfilefd < 0) |
351 { | 351 { |
352 close (filefd); | 352 close (filefd); |
353 report_file_error ("Opening process output file", Fcons (tempfile, Qnil)); | 353 report_file_error ("Opening process output file", |
354 } | 354 Fcons (build_string (tempfile), Qnil)); |
355 } | |
356 fd[0] = filefd; | |
355 fd[1] = outfilefd; | 357 fd[1] = outfilefd; |
356 #endif | 358 #endif /* MSDOS */ |
357 | 359 |
358 if (INTEGERP (buffer)) | 360 if (INTEGERP (buffer)) |
359 fd[1] = open (NULL_DEVICE, O_WRONLY), fd[0] = -1; | 361 fd[1] = open (NULL_DEVICE, O_WRONLY), fd[0] = -1; |
360 else | 362 else |
361 { | 363 { |
402 } | 404 } |
403 | 405 |
404 if (fd_error < 0) | 406 if (fd_error < 0) |
405 { | 407 { |
406 close (filefd); | 408 close (filefd); |
407 close (fd[0]); | 409 if (fd[0] != filefd) |
410 close (fd[0]); | |
408 if (fd1 >= 0) | 411 if (fd1 >= 0) |
409 close (fd1); | 412 close (fd1); |
410 report_file_error ("Cannot open", error_file); | 413 #ifdef MSDOS |
414 unlink (tempfile); | |
415 #endif | |
416 report_file_error ("Cannot redirect stderr", | |
417 Fcons ((NILP (error_file) | |
418 ? build_string (NULL_DEVICE) : error_file), | |
419 Qnil)); | |
411 } | 420 } |
412 #ifdef MSDOS /* MW, July 1993 */ | 421 #ifdef MSDOS /* MW, July 1993 */ |
413 /* ??? Someone who knows MSDOG needs to check whether this properly | 422 /* ??? Someone who knows MSDOG needs to check whether this properly |
414 closes all descriptors that it opens. | 423 closes all descriptors that it opens. |
415 | 424 |