aboutsummaryrefslogtreecommitdiffstats
path: root/src/callproc.c
diff options
context:
space:
mode:
authorPaul Eggert2014-04-16 12:43:46 -0700
committerPaul Eggert2014-04-16 12:43:46 -0700
commit290d7ac277986bd118e594a8100b3f40e4492cb1 (patch)
treed63a3aa61cac577dd119665edaffe2def8d194e2 /src/callproc.c
parent37eccff4f72c5a36dcd4b89d417b0047aab84e50 (diff)
parentb262bde327db2cd9b2f01f2d3ed946d0b188cb9d (diff)
downloademacs-290d7ac277986bd118e594a8100b3f40e4492cb1.tar.gz
emacs-290d7ac277986bd118e594a8100b3f40e4492cb1.zip
Merge from emacs-24; up to 2014-04-16T15:28:26Z!monnier@iro.umontreal.ca
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 2147c173655..a2c52e5b5ba 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 (sigset_t const *oldset)
124 pthread_sigmask (SIG_SETMASK, oldset, 0); 126 pthread_sigmask (SIG_SETMASK, oldset, 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 sigset_t oldset; 170 sigset_t oldset;
166 block_child_signal (&oldset); 171 block_child_signal (&oldset);
167 172
@@ -173,6 +178,7 @@ record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile)
173 } 178 }
174 179
175 unblock_child_signal (&oldset); 180 unblock_child_signal (&oldset);
181#endif /* !MSDOS */
176} 182}
177 183
178/* Clean up files, file descriptors and processes created by Fcall_process. */ 184/* Clean up files, file descriptors and processes created by Fcall_process. */
@@ -212,6 +218,7 @@ call_process_cleanup (Lisp_Object buffer)
212{ 218{
213 Fset_buffer (buffer); 219 Fset_buffer (buffer);
214 220
221#ifndef MSDOS
215 if (synch_process_pid) 222 if (synch_process_pid)
216 { 223 {
217 kill (-synch_process_pid, SIGINT); 224 kill (-synch_process_pid, SIGINT);
@@ -223,6 +230,7 @@ call_process_cleanup (Lisp_Object buffer)
223 immediate_quit = 0; 230 immediate_quit = 0;
224 message1 ("Waiting for process to die...done"); 231 message1 ("Waiting for process to die...done");
225 } 232 }
233#endif /* !MSDOS */
226} 234}
227 235
228#ifdef DOS_NT 236#ifdef DOS_NT
@@ -520,10 +528,10 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
520 char const *outf = tmpdir ? tmpdir : ""; 528 char const *outf = tmpdir ? tmpdir : "";
521 tempfile = alloca (strlen (outf) + 20); 529 tempfile = alloca (strlen (outf) + 20);
522 strcpy (tempfile, outf); 530 strcpy (tempfile, outf);
523 dostounix_filename (tempfile, 0); 531 dostounix_filename (tempfile);
524 if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/') 532 if (*tempfile == '\0' || tempfile[strlen (tempfile) - 1] != '/')
525 strcat (tempfile, "/"); 533 strcat (tempfile, "/");
526 strcat (tempfile, "detmp.XXX"); 534 strcat (tempfile, "emXXXXXX");
527 mktemp (tempfile); 535 mktemp (tempfile);
528 if (!*tempfile) 536 if (!*tempfile)
529 report_file_error ("Opening process output file", Qnil); 537 report_file_error ("Opening process output file", Qnil);
@@ -712,8 +720,6 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
712 unblock_child_signal (&oldset); 720 unblock_child_signal (&oldset);
713 unblock_input (); 721 unblock_input ();
714 722
715#endif /* not MSDOS */
716
717 if (pid < 0) 723 if (pid < 0)
718 report_file_errno ("Doing vfork", Qnil, child_errno); 724 report_file_errno ("Doing vfork", Qnil, child_errno);
719 725
@@ -728,6 +734,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
728 emacs_close (filefd); 734 emacs_close (filefd);
729 clear_unwind_protect (count - 1); 735 clear_unwind_protect (count - 1);
730 736
737#endif /* not MSDOS */
738
731 if (INTEGERP (buffer)) 739 if (INTEGERP (buffer))
732 return unbind_to (count, Qnil); 740 return unbind_to (count, Qnil);
733 741
@@ -1674,10 +1682,8 @@ syms_of_callproc (void)
1674{ 1682{
1675#ifndef DOS_NT 1683#ifndef DOS_NT
1676 Vtemp_file_name_pattern = build_string ("emacsXXXXXX"); 1684 Vtemp_file_name_pattern = build_string ("emacsXXXXXX");
1677#elif defined (WINDOWSNT) 1685#else /* DOS_NT */
1678 Vtemp_file_name_pattern = build_string ("emXXXXXX"); 1686 Vtemp_file_name_pattern = build_string ("emXXXXXX");
1679#else
1680 Vtemp_file_name_pattern = build_string ("detmp.XXX");
1681#endif 1687#endif
1682 staticpro (&Vtemp_file_name_pattern); 1688 staticpro (&Vtemp_file_name_pattern);
1683 1689