emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102397: * src/callproc.c (child_setu


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102397: * src/callproc.c (child_setup): Reorder code to simplify #ifdefs.
Date: Mon, 15 Nov 2010 09:11:08 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102397
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Mon 2010-11-15 09:11:08 -0800
message:
  * src/callproc.c (child_setup): Reorder code to simplify #ifdefs.
  No code changes.
modified:
  src/ChangeLog
  src/callproc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-11-15 06:27:41 +0000
+++ b/src/ChangeLog     2010-11-15 17:11:08 +0000
@@ -1,5 +1,8 @@
 2010-11-15  Dan Nicolaescu  <address@hidden>
 
+       * callproc.c (child_setup): Reorder code to simplify #ifdefs.
+       No code changes.
+
        * process.c: Include <sys/ioctl.h> unconditionally,
        keyboard.c already does it.
 

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2010-11-15 06:10:35 +0000
+++ b/src/callproc.c    2010-11-15 17:11:08 +0000
@@ -1154,6 +1154,14 @@
 #ifdef WINDOWSNT
   prepare_standard_handles (in, out, err, handles);
   set_process_dir (SDATA (current_dir));
+  /* Spawn the child.  (See ntproc.c:Spawnve).  */
+  cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
+  reset_standard_handles (in, out, err, handles);
+  if (cpid == -1)
+    /* An error occurred while trying to spawn the process.  */
+    report_file_error ("Spawning child process", Qnil);
+  return cpid;
+
 #else  /* not WINDOWSNT */
   /* Make sure that in, out, and err are not actually already in
      descriptors zero, one, or two; this could happen if Emacs is
@@ -1192,34 +1200,15 @@
     emacs_close (out);
   if (err != in && err != out)
     emacs_close (err);
-#endif /* not MSDOS */
-#endif /* not WINDOWSNT */
 
 #if defined(USG)
 #ifndef SETPGRP_RELEASES_CTTY
   setpgrp ();                  /* No arguments but equivalent in this case */
 #endif
-#else
+#else /* not USG */
   setpgrp (pid, pid);
-#endif /* USG */
+#endif /* not USG */
 
-#ifdef MSDOS
-  pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
-  xfree (pwd_var);
-  if (pid == -1)
-    /* An error occurred while trying to run the subprocess.  */
-    report_file_error ("Spawning child process", Qnil);
-  return pid;
-#else  /* not MSDOS */
-#ifdef WINDOWSNT
-  /* Spawn the child.  (See ntproc.c:Spawnve).  */
-  cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
-  reset_standard_handles (in, out, err, handles);
-  if (cpid == -1)
-    /* An error occurred while trying to spawn the process.  */
-    report_file_error ("Spawning child process", Qnil);
-  return cpid;
-#else /* not WINDOWSNT */
   /* setpgrp_of_tty is incorrect here; it uses input_fd.  */
   tcsetpgrp (0, pid);
 
@@ -1233,8 +1222,15 @@
   emacs_write (1, new_argv[0], strlen (new_argv[0]));
   emacs_write (1, "\n", 1);
   _exit (1);
-#endif /* not WINDOWSNT */
-#endif /* not MSDOS */
+
+#else /* MSDOS */
+  pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
+  xfree (pwd_var);
+  if (pid == -1)
+    /* An error occurred while trying to run the subprocess.  */
+    report_file_error ("Spawning child process", Qnil);
+  return pid;
+#endif  /* MSDOS */
 }
 
 #ifndef WINDOWSNT


reply via email to

[Prev in Thread] Current Thread [Next in Thread]