mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-02-12 00:16:30 +00:00
Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* job.c (reap_children): Don't call die if handling_fatal_signal. * job.c (start_job_command): Call block_sigs. (block_sigs): New function, broken out of start_job_command. (reap_children): Block fatal signals around removing dead child from chain and adjusting job_slots_used. * job.h: Declare block_sigs. * job.c (reap_children): Quiescent value of shell_function_pid is zero, not -1.
This commit is contained in:
parent
610526fee7
commit
bdc49369eb
1 changed files with 18 additions and 14 deletions
32
job.c
32
job.c
|
@ -417,31 +417,31 @@ reap_children (block, err)
|
||||||
{
|
{
|
||||||
HANDLE hPID;
|
HANDLE hPID;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* wait for anything to finish */
|
/* wait for anything to finish */
|
||||||
if (hPID = process_wait_for_any()) {
|
if (hPID = process_wait_for_any()) {
|
||||||
|
|
||||||
/* was an error found on this process? */
|
/* was an error found on this process? */
|
||||||
err = process_last_err(hPID);
|
err = process_last_err(hPID);
|
||||||
|
|
||||||
/* get exit data */
|
/* get exit data */
|
||||||
exit_code = process_exit_code(hPID);
|
exit_code = process_exit_code(hPID);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
fprintf(stderr, "make (e=%d): %s",
|
fprintf(stderr, "make (e=%d): %s",
|
||||||
exit_code, map_win32_error_to_string(exit_code));
|
exit_code, map_win32_error_to_string(exit_code));
|
||||||
|
|
||||||
exit_sig = process_signal(hPID);
|
exit_sig = process_signal(hPID);
|
||||||
|
|
||||||
/* cleanup process */
|
/* cleanup process */
|
||||||
process_cleanup(hPID);
|
process_cleanup(hPID);
|
||||||
|
|
||||||
if (dos_batch_file) {
|
if (dos_batch_file) {
|
||||||
remove (dos_bname);
|
remove (dos_bname);
|
||||||
remove (dos_bename);
|
remove (dos_bename);
|
||||||
dos_batch_file = 0;
|
dos_batch_file = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
coredump = 0;
|
coredump = 0;
|
||||||
}
|
}
|
||||||
pid = (int) hPID;
|
pid = (int) hPID;
|
||||||
|
@ -601,7 +601,9 @@ reap_children (block, err)
|
||||||
|
|
||||||
/* If the job failed, and the -k flag was not given, die,
|
/* If the job failed, and the -k flag was not given, die,
|
||||||
unless we are already in the process of dying. */
|
unless we are already in the process of dying. */
|
||||||
if (!err && child_failed && !keep_going_flag)
|
if (!err && child_failed && !keep_going_flag &&
|
||||||
|
/* fatal_error_signal will die with the right signal. */
|
||||||
|
!handling_fatal_signal)
|
||||||
die (2);
|
die (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -636,6 +638,10 @@ free_child (child)
|
||||||
free ((char *) child);
|
free ((char *) child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef POSIX
|
||||||
|
extern sigset_t fatal_signal_set;
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
block_sigs ()
|
block_sigs ()
|
||||||
{
|
{
|
||||||
|
@ -656,8 +662,6 @@ unblock_sigs ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
extern sigset_t fatal_signal_set;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
unblock_sigs ()
|
unblock_sigs ()
|
||||||
{
|
{
|
||||||
|
@ -971,7 +975,7 @@ start_job_command (child)
|
||||||
fprintf(stderr, "%s ", argv[i]);
|
fprintf(stderr, "%s ", argv[i]);
|
||||||
fprintf(stderr, "\nCounted %d args in failed launch\n", i);
|
fprintf(stderr, "\nCounted %d args in failed launch\n", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
#endif /* Not MSDOS. */
|
#endif /* Not MSDOS. */
|
||||||
|
|
||||||
|
@ -1994,7 +1998,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
||||||
* This is technically an else to the above 'if (no_default_sh_exe)',
|
* This is technically an else to the above 'if (no_default_sh_exe)',
|
||||||
* but (IMHO) coding if-else across ifdef is dangerous.
|
* but (IMHO) coding if-else across ifdef is dangerous.
|
||||||
*/
|
*/
|
||||||
if (!no_default_sh_exe)
|
if (!no_default_sh_exe)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* SHELL may be a multi-word command. Construct a command line
|
/* SHELL may be a multi-word command. Construct a command line
|
||||||
|
@ -2091,7 +2095,7 @@ construct_command_argv (line, restp, file)
|
||||||
* is not confused.
|
* is not confused.
|
||||||
*/
|
*/
|
||||||
if (shell) {
|
if (shell) {
|
||||||
char *p = w32ify(shell, 0);
|
char *p = w32ify(shell, 0);
|
||||||
strcpy(shell, p);
|
strcpy(shell, p);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue