]> code.delx.au - gnu-emacs/blobdiff - src/callproc.c
merge from trunk
[gnu-emacs] / src / callproc.c
index 4ad6bcf41ea9231f96abbdc9ca33d66dd857e30e..de28ffa42efbe5659648191cd8ec5f6758108965 100644 (file)
@@ -102,8 +102,6 @@ Lisp_Object Vconfigure_info_directory, Vshared_game_score_directory;
 /* Pattern used by call-process-region to make temp files.  */
 static Lisp_Object Vtemp_file_name_pattern;
 
-extern Lisp_Object Vtemporary_file_directory;
-
 Lisp_Object Vshell_file_name;
 
 Lisp_Object Vprocess_environment, Vinitial_environment;
@@ -117,7 +115,7 @@ Lisp_Object Qbuffer_file_type;
 int synch_process_alive;
 
 /* Nonzero => this is a string explaining death of synchronous subprocess.  */
-char *synch_process_death;
+const char *synch_process_death;
 
 /* Nonzero => this is the signal number that terminated the subprocess.  */
 int synch_process_termsig;
@@ -612,12 +610,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
     {
       if (fd[0] >= 0)
        emacs_close (fd[0]);
-#ifndef subprocesses
-      /* If Emacs has been built with asynchronous subprocess support,
-        we don't need to do this, I think because it will then have
-        the facilities for handling SIGCHLD.  */
-      wait_without_blocking ();
-#endif /* subprocesses */
       return Qnil;
     }
 
@@ -811,8 +803,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
             make_number (total_read));
   }
 
+#ifndef MSDOS
   /* Wait for it to terminate, unless it already has.  */
   wait_for_termination (pid);
+#endif
 
   immediate_quit = 0;
 
@@ -824,7 +818,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
 
   if (synch_process_termsig)
     {
-      char *signame;
+      const char *signame;
 
       synchronize_system_messages_locale ();
       signame = strsignal (synch_process_termsig);
@@ -988,7 +982,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
   RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args)));
 }
 \f
+#ifndef WINDOWSNT
 static int relocate_fd (int fd, int minfd);
+#endif
 
 static char **
 add_env (char **env, char **new_env, char *string)
@@ -1054,19 +1050,9 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
 
   int pid = getpid ();
 
-#ifdef SET_EMACS_PRIORITY
-  {
-    extern EMACS_INT emacs_priority;
-
-    if (emacs_priority < 0)
-      nice (- emacs_priority);
-  }
-#endif
-
-#ifdef subprocesses
   /* Close Emacs's descriptors that this process should not have.  */
   close_process_descs ();
-#endif
+
   /* DOS_NT isn't in a vfork, so if we are in the middle of load-file,
      we will lose if we call close_load_descs here.  */
 #ifndef DOS_NT
@@ -1127,7 +1113,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
     char **p, **q;
     register int new_length;
     Lisp_Object display = Qnil;
-    
+
     new_length = 0;
 
     for (tem = Vprocess_environment;
@@ -1163,7 +1149,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
        but with corrected value.  */
     if (egetenv ("PWD"))
       *new_env++ = pwd_var;
+
     if (STRINGP (display))
       {
        int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1;
@@ -1193,7 +1179,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
       }
   }
 
-  
+
 #ifdef WINDOWSNT
   prepare_standard_handles (in, out, err, handles);
   set_process_dir (SDATA (current_dir));
@@ -1279,6 +1265,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
 #endif /* not MSDOS */
 }
 
+#ifndef WINDOWSNT
 /* Move the file descriptor FD so that its number is not less than MINFD.
    If the file descriptor is moved at all, the original is freed.  */
 static int
@@ -1312,6 +1299,7 @@ relocate_fd (int fd, int minfd)
       return new;
     }
 }
+#endif /* not WINDOWSNT */
 
 static int
 getenv_internal_1 (const char *var, int varlen, char **value, int *valuelen,
@@ -1540,13 +1528,12 @@ void
 set_initial_environment (void)
 {
   register char **envp;
-#ifndef CANNOT_DUMP
-  if (initialized)
-    {
+#ifdef CANNOT_DUMP
+  Vprocess_environment = Qnil;
 #else
-    {
-      Vprocess_environment = Qnil;
+  if (initialized)
 #endif
+    {
       for (envp = environ; *envp; envp++)
        Vprocess_environment = Fcons (build_string (*envp),
                                      Vprocess_environment);