aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Nicolaescu2010-11-15 09:11:08 -0800
committerDan Nicolaescu2010-11-15 09:11:08 -0800
commit678029433d360cf1e5a95de28168b69ed1c6f9a7 (patch)
tree474205488563f247529293648bd35311ed2d73f8 /src
parent84992dff60e450d1c81283fac2b77294e8ad7755 (diff)
downloademacs-678029433d360cf1e5a95de28168b69ed1c6f9a7.tar.gz
emacs-678029433d360cf1e5a95de28168b69ed1c6f9a7.zip
* src/callproc.c (child_setup): Reorder code to simplify #ifdefs.
No code changes.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/callproc.c42
2 files changed, 22 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 912e9ae27cd..49c179aeb46 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12010-11-15 Dan Nicolaescu <dann@ics.uci.edu> 12010-11-15 Dan Nicolaescu <dann@ics.uci.edu>
2 2
3 * callproc.c (child_setup): Reorder code to simplify #ifdefs.
4 No code changes.
5
3 * process.c: Include <sys/ioctl.h> unconditionally, 6 * process.c: Include <sys/ioctl.h> unconditionally,
4 keyboard.c already does it. 7 keyboard.c already does it.
5 8
diff --git a/src/callproc.c b/src/callproc.c
index 5941f8180ff..8838ccb7680 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1154,6 +1154,14 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
1154#ifdef WINDOWSNT 1154#ifdef WINDOWSNT
1155 prepare_standard_handles (in, out, err, handles); 1155 prepare_standard_handles (in, out, err, handles);
1156 set_process_dir (SDATA (current_dir)); 1156 set_process_dir (SDATA (current_dir));
1157 /* Spawn the child. (See ntproc.c:Spawnve). */
1158 cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
1159 reset_standard_handles (in, out, err, handles);
1160 if (cpid == -1)
1161 /* An error occurred while trying to spawn the process. */
1162 report_file_error ("Spawning child process", Qnil);
1163 return cpid;
1164
1157#else /* not WINDOWSNT */ 1165#else /* not WINDOWSNT */
1158 /* Make sure that in, out, and err are not actually already in 1166 /* Make sure that in, out, and err are not actually already in
1159 descriptors zero, one, or two; this could happen if Emacs is 1167 descriptors zero, one, or two; this could happen if Emacs is
@@ -1192,34 +1200,15 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
1192 emacs_close (out); 1200 emacs_close (out);
1193 if (err != in && err != out) 1201 if (err != in && err != out)
1194 emacs_close (err); 1202 emacs_close (err);
1195#endif /* not MSDOS */
1196#endif /* not WINDOWSNT */
1197 1203
1198#if defined(USG) 1204#if defined(USG)
1199#ifndef SETPGRP_RELEASES_CTTY 1205#ifndef SETPGRP_RELEASES_CTTY
1200 setpgrp (); /* No arguments but equivalent in this case */ 1206 setpgrp (); /* No arguments but equivalent in this case */
1201#endif 1207#endif
1202#else 1208#else /* not USG */
1203 setpgrp (pid, pid); 1209 setpgrp (pid, pid);
1204#endif /* USG */ 1210#endif /* not USG */
1205 1211
1206#ifdef MSDOS
1207 pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
1208 xfree (pwd_var);
1209 if (pid == -1)
1210 /* An error occurred while trying to run the subprocess. */
1211 report_file_error ("Spawning child process", Qnil);
1212 return pid;
1213#else /* not MSDOS */
1214#ifdef WINDOWSNT
1215 /* Spawn the child. (See ntproc.c:Spawnve). */
1216 cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
1217 reset_standard_handles (in, out, err, handles);
1218 if (cpid == -1)
1219 /* An error occurred while trying to spawn the process. */
1220 report_file_error ("Spawning child process", Qnil);
1221 return cpid;
1222#else /* not WINDOWSNT */
1223 /* setpgrp_of_tty is incorrect here; it uses input_fd. */ 1212 /* setpgrp_of_tty is incorrect here; it uses input_fd. */
1224 tcsetpgrp (0, pid); 1213 tcsetpgrp (0, pid);
1225 1214
@@ -1233,8 +1222,15 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
1233 emacs_write (1, new_argv[0], strlen (new_argv[0])); 1222 emacs_write (1, new_argv[0], strlen (new_argv[0]));
1234 emacs_write (1, "\n", 1); 1223 emacs_write (1, "\n", 1);
1235 _exit (1); 1224 _exit (1);
1236#endif /* not WINDOWSNT */ 1225
1237#endif /* not MSDOS */ 1226#else /* MSDOS */
1227 pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env);
1228 xfree (pwd_var);
1229 if (pid == -1)
1230 /* An error occurred while trying to run the subprocess. */
1231 report_file_error ("Spawning child process", Qnil);
1232 return pid;
1233#endif /* MSDOS */
1238} 1234}
1239 1235
1240#ifndef WINDOWSNT 1236#ifndef WINDOWSNT