~sdeziel/apparmor/dnsmasq-lxd-bridge

« back to all changes in this revision

Viewing changes to tests/regression/apparmor/onexec.c

  • Committer: Steve Beattie
  • Date: 2016-03-19 08:35:42 UTC
  • Revision ID: sbeattie@ubuntu.com-20160319083542-2nsnispd0f1xg6d4
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 <steve@nxnw.org>
Acked-by: Tyler Hicks <tyhicks@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
        /* stop after onexec and wait to for continue before exec so
47
47
         * caller can introspect task */
48
 
        (void)kill(getpid(), SIGSTOP);
 
48
        rc = kill(getpid(), SIGSTOP);
 
49
        if (rc == -1){
 
50
                fprintf(stderr, "FAIL: signal to self failed - %s\n",
 
51
                        strerror(errno));
 
52
                exit(errno);
 
53
        }
49
54
 
50
55
        (void)execve(argv[2], &argv[2], environ);
51
56
        /* exec failed, kill outselves to flag parent */