aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 450fc57f929..54bc5cd9dc0 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1009,23 +1009,11 @@ create_temp_file (ptrdiff_t nargs, Lisp_Object *args)
1009 tempfile = SSDATA (filename_string); 1009 tempfile = SSDATA (filename_string);
1010 1010
1011 { 1011 {
1012 int fd; 1012 int fd = mkostemp (tempfile, O_CLOEXEC);
1013
1014#ifdef HAVE_MKOSTEMP
1015 fd = mkostemp (tempfile, O_CLOEXEC);
1016#elif defined HAVE_MKSTEMP
1017 fd = mkstemp (tempfile);
1018#else
1019 errno = EEXIST;
1020 mktemp (tempfile);
1021 fd = *tempfile ? 0 : -1;
1022#endif
1023 if (fd < 0) 1013 if (fd < 0)
1024 report_file_error ("Failed to open temporary file using pattern", 1014 report_file_error ("Failed to open temporary file using pattern",
1025 pattern); 1015 pattern);
1026#if defined HAVE_MKOSTEMP || defined HAVE_MKSTEMP
1027 emacs_close (fd); 1016 emacs_close (fd);
1028#endif
1029 } 1017 }
1030 1018
1031 record_unwind_protect (delete_temp_file, filename_string); 1019 record_unwind_protect (delete_temp_file, filename_string);