diff options
author | Eli Zaretskii <eliz@gnu.org> | 2012-12-05 19:10:00 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2012-12-05 19:10:00 +0200 |
commit | d3cefd1358e021cc4d510afb18916b067e6b1419 (patch) | |
tree | 7048e81479caada6f2cb885c6fa2d1f0b1d814e5 | |
parent | 4038c7a2fdbffff1f9786eb11f29ea544d1ee1a1 (diff) | |
download | emacs-d3cefd1358e021cc4d510afb18916b067e6b1419.tar.gz |
Fix one part of bug #13079 with temporary files in call-process-region.
src/callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
fails, signal an error instead of continuing with an empty
string.
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/callproc.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6d2cd720672..e71667f7dcf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-12-05 Eli Zaretskii <eliz@gnu.org> + + * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp + fails, signal an error instead of continuing with an empty + string. (Bug#13079) + 2012-12-04 Eli Zaretskii <eliz@gnu.org> * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]: diff --git a/src/callproc.c b/src/callproc.c index c236f22fc86..ce3b11af696 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -977,7 +977,15 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r close (fd); } #else + errno = 0; mktemp (tempfile); + if (!*tempfile) + { + if (!errno) + errno = EEXIST; + report_file_error ("Failed to open temporary file using pattern", + Fcons (pattern, Qnil)); + } #endif filename_string = build_string (tempfile); |