diff options
| author | Paul Eggert | 2013-07-07 00:28:29 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-07 00:28:29 -0700 |
| commit | 5f86adcd2c79e58c6ceeb30fb26c44e830b26a3e (patch) | |
| tree | 594eecc4b1ef2e57230f67136801fcdfb2347b82 /src/callproc.c | |
| parent | 6ed7a66a3f8781f66fce33f326ac2c5057de4c97 (diff) | |
| download | emacs-5f86adcd2c79e58c6ceeb30fb26c44e830b26a3e.tar.gz emacs-5f86adcd2c79e58c6ceeb30fb26c44e830b26a3e.zip | |
Fix openp errno handling.
* callproc.c (Fcall_process): Preserve openp errno around close.
* lread.c (openp): Set errno when returning -1, as some callers
expect this.
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/callproc.c b/src/callproc.c index 6de8113dc14..185dc9a493e 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -436,7 +436,9 @@ usage: (call-process PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS) * | |||
| 436 | } | 436 | } |
| 437 | if (NILP (path)) | 437 | if (NILP (path)) |
| 438 | { | 438 | { |
| 439 | int openp_errno = errno; | ||
| 439 | emacs_close (filefd); | 440 | emacs_close (filefd); |
| 441 | errno = openp_errno; | ||
| 440 | report_file_error ("Searching for program", Fcons (args[0], Qnil)); | 442 | report_file_error ("Searching for program", Fcons (args[0], Qnil)); |
| 441 | } | 443 | } |
| 442 | 444 | ||