aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorEli Zaretskii2012-11-17 18:46:45 +0200
committerEli Zaretskii2012-11-17 18:46:45 +0200
commit22bae83fa8c432780fe20202a660aa8c84f3087a (patch)
treee58043c1a42681cc2ba63a20c5d85c84a1dbb6ad /src/process.c
parenta631d0e04747884855aa460cb903d1fd2ff106f4 (diff)
downloademacs-22bae83fa8c432780fe20202a660aa8c84f3087a.tar.gz
emacs-22bae83fa8c432780fe20202a660aa8c84f3087a.zip
Fix bug #12829 with aborts on MS-Windows when several child processes die.
nt/inc/sys/wait.h: New file, with prototype of waitpid and definitions of macros it needs. nt/inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore. (sys_wait): Remove prototype. nt/config.nt (HAVE_SYS_WAIT_H): Define to 1. src/w32proc.c (create_child): Don't clip the PID of the child process to fit into an Emacs integer, as this is no longer a restriction. (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by reaping only the process specified by PID argument, if that is positive. Use PID instead of dead_child to know which process to reap. Wait for the child to die only if WNOHANG is not in OPTIONS. (sys_select): Don't set dead_child. src/sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion, as it is no longer needed. src/process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions, no longer needed. (record_child_status_change): Remove the setting of record_at_most_one_child for the !WNOHANG case.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/process.c b/src/process.c
index 785282fba36..5fe6a6540f3 100644
--- a/src/process.c
+++ b/src/process.c
@@ -130,18 +130,6 @@ extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
130 EMACS_TIME *, void *); 130 EMACS_TIME *, void *);
131#endif 131#endif
132 132
133/* This is for DOS_NT ports. FIXME: Remove this old portability cruft
134 by having DOS_NT ports implement waitpid instead of wait. Nowadays
135 POSIXish hosts all define waitpid, WNOHANG, and WUNTRACED, as these
136 have been standard since POSIX.1-1988. */
137#ifndef WNOHANG
138# undef waitpid
139# define waitpid(pid, status, options) wait (status)
140#endif
141#ifndef WUNTRACED
142# define WUNTRACED 0
143#endif
144
145/* Work around GCC 4.7.0 bug with strict overflow checking; see 133/* Work around GCC 4.7.0 bug with strict overflow checking; see
146 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>. 134 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904>.
147 These lines can be removed once the GCC bug is fixed. */ 135 These lines can be removed once the GCC bug is fixed. */
@@ -6295,17 +6283,9 @@ record_child_status_change (pid_t pid, int w)
6295{ 6283{
6296#ifdef SIGCHLD 6284#ifdef SIGCHLD
6297 6285
6298# ifdef WNOHANG
6299 /* On POSIXish hosts, record at most one child only if we already 6286 /* On POSIXish hosts, record at most one child only if we already
6300 know one child that has exited. */ 6287 know one child that has exited. */
6301 bool record_at_most_one_child = 0 <= pid; 6288 bool record_at_most_one_child = 0 <= pid;
6302# else
6303 /* On DOS_NT (the only porting target that lacks WNOHANG),
6304 record the status of at most one child process, since the SIGCHLD
6305 handler must return right away. If any more processes want to
6306 signal us, we will get another signal. */
6307 bool record_at_most_one_child = 1;
6308# endif
6309 6289
6310 Lisp_Object tail; 6290 Lisp_Object tail;
6311 6291