summaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-11-28 19:59:45 +0100
committerFlorian Weimer <fweimer@redhat.com>2018-11-28 20:57:18 +0100
commit96cd0558bcd69481ccc42e1b392f0c0b36fce2b0 (patch)
tree9318349a9edfb5c5e6314c9bb560ff909511bbfc /libio
parent530504e3a825a63ad4976f24cd50aa9b15d3b91e (diff)
downloadglibc-96cd0558bcd69481ccc42e1b392f0c0b36fce2b0.tar.gz
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 'libio')
-rw-r--r--libio/tst-vtables-common.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libio/tst-vtables-common.c b/libio/tst-vtables-common.c
index 5e31012069..85e246cd11 100644
--- a/libio/tst-vtables-common.c
+++ b/libio/tst-vtables-common.c
@@ -380,21 +380,6 @@ without_compatibility_fflush (void *closure)
_exit (1);
}
-/* Exit status after abnormal termination. */
-static int termination_status;
-
-static void
-init_termination_status (void)
-{
- pid_t pid = xfork ();
- if (pid == 0)
- abort ();
- xwaitpid (pid, &termination_status, 0);
-
- TEST_VERIFY (WIFSIGNALED (termination_status));
- TEST_COMPARE (WTERMSIG (termination_status), SIGABRT);
-}
-
static void
check_for_termination (const char *name, void (*callback) (void *))
{
@@ -404,7 +389,7 @@ check_for_termination (const char *name, void (*callback) (void *))
shared->calls = 0;
struct support_capture_subprocess proc
= support_capture_subprocess (callback, NULL);
- support_capture_subprocess_check (&proc, name, termination_status,
+ support_capture_subprocess_check (&proc, name, -SIGABRT,
sc_allow_stderr);
const char *message
= "Fatal error: glibc detected an invalid stdio handle\n";
@@ -491,7 +476,6 @@ run_tests (bool initially_disabled)
shared = support_shared_allocate (sizeof (*shared));
shared->initially_disabled = initially_disabled;
- init_termination_status ();
if (initially_disabled)
{