diff options
author | Florian Weimer <fweimer@redhat.com> | 2018-11-28 19:59:45 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2018-11-28 20:57:18 +0100 |
commit | 96cd0558bcd69481ccc42e1b392f0c0b36fce2b0 (patch) | |
tree | 9318349a9edfb5c5e6314c9bb560ff909511bbfc /support/capture_subprocess.h | |
parent | 530504e3a825a63ad4976f24cd50aa9b15d3b91e (diff) | |
download | glibc-96cd0558bcd69481ccc42e1b392f0c0b36fce2b0.tar.gz glibc-96cd0558bcd69481ccc42e1b392f0c0b36fce2b0.tar.xz glibc-96cd0558bcd69481ccc42e1b392f0c0b36fce2b0.zip |
support: Add signal support to support_capture_subprocess_check
Signal zero does not terminate a process, so it is safe to use negative values for signal numbers. Adjust libio/tst-vtables-common.c to use this new functionality, instead of determining the termination status for a signal indirectly.
Diffstat (limited to 'support/capture_subprocess.h')
-rw-r--r-- | support/capture_subprocess.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/support/capture_subprocess.h b/support/capture_subprocess.h index b0886ba1d1..4734b877ad 100644 --- a/support/capture_subprocess.h +++ b/support/capture_subprocess.h @@ -49,13 +49,16 @@ enum support_capture_allow sc_allow_stderr = 0x04, }; -/* Check that the subprocess exited with STATUS and that only the - allowed outputs happened. ALLOWED is a combination of - support_capture_allow flags. Report errors under the CONTEXT - message. */ +/* Check that the subprocess exited and that only the allowed outputs + happened. If STATUS_OR_SIGNAL is nonnegative, it is the expected + (decoded) exit status of the process, as returned by WEXITSTATUS. + If STATUS_OR_SIGNAL is negative, -STATUS_OR_SIGNAL is the expected + termination signal, as returned by WTERMSIG. ALLOWED is a + combination of support_capture_allow flags. Report errors under + the CONTEXT message. */ void support_capture_subprocess_check (struct support_capture_subprocess *, - const char *context, int status, - int allowed) + const char *context, + int status_or_signal, int allowed) __attribute__ ((nonnull (1, 2))); #endif /* SUPPORT_CAPTURE_SUBPROCESS_H */ |