aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 2ce4a7dcc0d..9e60ba11bcf 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -105,6 +105,8 @@ enum
105 105
106static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t); 106static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
107 107
108
109#ifndef MSDOS
108/* Block SIGCHLD. */ 110/* Block SIGCHLD. */
109 111
110void 112void
@@ -124,6 +126,8 @@ unblock_child_signal (void)
124 pthread_sigmask (SIG_SETMASK, &empty_mask, 0); 126 pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
125} 127}
126 128
129#endif /* !MSDOS */
130
127/* Return the current buffer's working directory, or the home 131/* Return the current buffer's working directory, or the home
128 directory if it's unreachable, as a string suitable for a system call. 132 directory if it's unreachable, as a string suitable for a system call.
129 Signal an error if the result would not be an accessible directory. */ 133 Signal an error if the result would not be an accessible directory. */
@@ -162,6 +166,7 @@ encode_current_directory (void)
162void 166void
163record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile) 167record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile)
164{ 168{
169#ifndef MSDOS
165 block_child_signal (); 170 block_child_signal ();
166 171
167 if (p->alive) 172 if (p->alive)
@@ -172,6 +177,7 @@ record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile)
172 } 177 }
173 178
174 unblock_child_signal (); 179 unblock_child_signal ();
180#endif /* !MSDOS */
175} 181}
176 182
177/* Clean up files, file descriptors and processes created by Fcall_process. */ 183/* Clean up files, file descriptors and processes created by Fcall_process. */
@@ -211,6 +217,7 @@ call_process_cleanup (Lisp_Object buffer)
211{ 217{
212 Fset_buffer (buffer); 218 Fset_buffer (buffer);
213 219
220#ifndef MSDOS
214 if (synch_process_pid) 221 if (synch_process_pid)
215 { 222 {
216 kill (-synch_process_pid, SIGINT); 223 kill (-synch_process_pid, SIGINT);
@@ -222,6 +229,7 @@ call_process_cleanup (Lisp_Object buffer)
222 immediate_quit = 0; 229 immediate_quit = 0;
223 message1 ("Waiting for process to die...done"); 230 message1 ("Waiting for process to die...done");
224 } 231 }
232#endif /* !MSDOS */
225} 233}
226 234
227#ifdef DOS_NT 235#ifdef DOS_NT
@@ -518,10 +526,10 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
518 char const *outf = tmpdir ? tmpdir : ""; 526 char const *outf = tmpdir ? tmpdir : "";
519 tempfile = alloca (strlen (outf) + 20); 527 tempfile = alloca (strlen (outf) + 20);
520 strcpy (tempfile, outf); 528 strcpy (tempfile, outf);
521 dostounix_filename (tempfile, 0); 529 dostounix_filename (tempfile);
522 if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/') 530 if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')
523 strcat (tempfile, "/"); 531 strcat (tempfile, "/");
524 strcat (tempfile, "detmp.XXX"); 532 strcat (tempfile, "emXXXXXX");
525 mktemp (tempfile); 533 mktemp (tempfile);
526 if (!*tempfile) 534 if (!*tempfile)
527 report_file_error ("Opening process output file", Qnil); 535 report_file_error ("Opening process output file", Qnil);
@@ -710,8 +718,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
710 unblock_child_signal (); 718 unblock_child_signal ();
711 unblock_input (); 719 unblock_input ();
712 720
713#endif /* not MSDOS */
714
715 if (pid < 0) 721 if (pid < 0)
716 report_file_errno ("Doing vfork", Qnil, child_errno); 722 report_file_errno ("Doing vfork", Qnil, child_errno);
717 723
@@ -726,6 +732,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
726 emacs_close (filefd); 732 emacs_close (filefd);
727 clear_unwind_protect (count - 1); 733 clear_unwind_protect (count - 1);
728 734
735#endif /* not MSDOS */
736
729 if (INTEGERP (buffer)) 737 if (INTEGERP (buffer))
730 return unbind_to (count, Qnil); 738 return unbind_to (count, Qnil);
731 739
@@ -1672,10 +1680,8 @@ syms_of_callproc (void)
1672{ 1680{
1673#ifndef DOS_NT 1681#ifndef DOS_NT
1674 Vtemp_file_name_pattern = build_string ("emacsXXXXXX"); 1682 Vtemp_file_name_pattern = build_string ("emacsXXXXXX");
1675#elif defined (WINDOWSNT) 1683#else /* DOS_NT */
1676 Vtemp_file_name_pattern = build_string ("emXXXXXX"); 1684 Vtemp_file_name_pattern = build_string ("emXXXXXX");
1677#else
1678 Vtemp_file_name_pattern = build_string ("detmp.XXX");
1679#endif 1685#endif
1680 staticpro (&Vtemp_file_name_pattern); 1686 staticpro (&Vtemp_file_name_pattern);
1681 1687