From 0e2bbc98b8fb67b9fce89029af59b5dc5fd406bc Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Sat, 19 Mar 2016 01:35:42 -0700 Subject: [PATCH] tests: onexec - check and report signal failure The onexec test was ignoring errors from the kill() call, so it didn't notice when it had failed to send SIGSTOP to itself. Signed-off-by: Steve Beattie Acked-by: Tyler Hicks --- tests/regression/apparmor/onexec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/regression/apparmor/onexec.c b/tests/regression/apparmor/onexec.c index bcb52580e..f9beb3a61 100644 --- a/tests/regression/apparmor/onexec.c +++ b/tests/regression/apparmor/onexec.c @@ -45,7 +45,12 @@ int main(int argc, char *argv[]) /* stop after onexec and wait to for continue before exec so * caller can introspect task */ - (void)kill(getpid(), SIGSTOP); + rc = kill(getpid(), SIGSTOP); + if (rc == -1){ + fprintf(stderr, "FAIL: signal to self failed - %s\n", + strerror(errno)); + exit(errno); + } (void)execve(argv[2], &argv[2], environ); /* exec failed, kill outselves to flag parent */