diff options
| author | Eli Zaretskii | 2012-12-05 19:10:00 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-12-05 19:10:00 +0200 |
| commit | d3cefd1358e021cc4d510afb18916b067e6b1419 (patch) | |
| tree | 7048e81479caada6f2cb885c6fa2d1f0b1d814e5 /src | |
| parent | 4038c7a2fdbffff1f9786eb11f29ea544d1ee1a1 (diff) | |
| download | emacs-d3cefd1358e021cc4d510afb18916b067e6b1419.tar.gz emacs-d3cefd1358e021cc4d510afb18916b067e6b1419.zip | |
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.
Diffstat (limited to 'src')
| -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 @@ | |||
| 1 | 2012-12-05 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp | ||
| 4 | fails, signal an error instead of continuing with an empty | ||
| 5 | string. (Bug#13079) | ||
| 6 | |||
| 1 | 2012-12-04 Eli Zaretskii <eliz@gnu.org> | 7 | 2012-12-04 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]: | 9 | * 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 | |||
| 977 | close (fd); | 977 | close (fd); |
| 978 | } | 978 | } |
| 979 | #else | 979 | #else |
| 980 | errno = 0; | ||
| 980 | mktemp (tempfile); | 981 | mktemp (tempfile); |
| 982 | if (!*tempfile) | ||
| 983 | { | ||
| 984 | if (!errno) | ||
| 985 | errno = EEXIST; | ||
| 986 | report_file_error ("Failed to open temporary file using pattern", | ||
| 987 | Fcons (pattern, Qnil)); | ||
| 988 | } | ||
| 981 | #endif | 989 | #endif |
| 982 | 990 | ||
| 983 | filename_string = build_string (tempfile); | 991 | filename_string = build_string (tempfile); |