summaryrefslogtreecommitdiff
path: root/lib/wait-process.h
diff options
context:
space:
mode:
authorDerek R. Price <derek@ximbiot.com>2006-04-25 20:58:26 +0000
committerDerek R. Price <derek@ximbiot.com>2006-04-25 20:58:26 +0000
commit6d8d4e520be656b646a6f5cf7ebebfc31c178022 (patch)
tree99edbed416b6e9dba5124a90985c54586451902f /lib/wait-process.h
parent528b229aa8932bc5e1fdf7b0c7cdc5b7713b1edf (diff)
downloadgnulib-6d8d4e520be656b646a6f5cf7ebebfc31c178022.tar.gz
* lib/wait-process.h (wait_subprocess): Accept a new exitsignal argument.
* lib/wait-process.c (wait_subprocess): Always set *exitsignal to 0 when present and set it to the offending signal when the child exits due to a signal. * lib/csharpcomp.c, lib/execute.c, lib/javacomp.c: Update all callers.
Diffstat (limited to 'lib/wait-process.h')
-rw-r--r--lib/wait-process.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/wait-process.h b/lib/wait-process.h
index 9cdce30478..f1f7776740 100644
--- a/lib/wait-process.h
+++ b/lib/wait-process.h
@@ -34,11 +34,14 @@ extern "C" {
/* Wait for a subprocess to finish. Return its exit code.
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
- return 127.
+ return 127 and set exitsignal if the child terminated because of a signal.
Arguments:
- child is the pid of the subprocess.
- progname is the name of the program executed by the subprocess, used for
error messages.
+ - exitsignal is an optional pointer to an int to hold the signal number of
+ any signal that caused the child to exit. It will be set to zero if this
+ function exits with an error not caused by the child catching a signal.
- If ignore_sigpipe is true, consider a subprocess termination due to
SIGPIPE as equivalent to a success. This is suitable for processes whose
only purpose is to write to standard output. This flag can be safely set
@@ -50,6 +53,7 @@ extern "C" {
- If exit_on_error is true, any error will cause the main process to exit
with an error status. */
extern int wait_subprocess (pid_t child, const char *progname,
+ int *exitsignal,
bool ignore_sigpipe, bool null_stderr,
bool slave_process, bool exit_on_error);