Handle both signals and errors in child processes, rather than just signals
as before.
This commit is contained in:
parent
11851b0ee1
commit
b5d3f86c3f
@ -19,6 +19,7 @@
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
@ -137,8 +138,12 @@ do_system_command (command)
|
||||
else
|
||||
status = system (command);
|
||||
|
||||
if (status)
|
||||
if (WIFSIGNALED(status))
|
||||
return 0;
|
||||
else if (WEXITSTATUS(status)) {
|
||||
gripe_system_command (status);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user