opr: ExitHandler: re-raise the signal instead of exiting with that code 89/12489/2
authorAnders Kaseorg <andersk@mit.edu>
Wed, 14 Dec 2016 22:52:35 +0000 (17:52 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 22 Dec 2016 18:28:19 +0000 (13:28 -0500)
This fixes a ‘make check’ failure introduced by commit
803d15b6aa1e65b259ba11ca30aa1afd2e12accb “vlserver: convert the vlserver
to opr softsig”:

    $ make check
    …
    volser/vos..............FAILED 6
    …
    $ cd tests
    $ ./libwrap ../lib ./runtests -o volser/vos
    1..6
    ok 1 - Successfully got security class
    ok 2 - Successfully built ubik client structure
    ok 3 - First address registration succeeds
    ok 4 - Second address registration succeeds
    ok 5 - vos output matches
    Server exited with code 15
    # wanted: 0
    #   seen: -1
    not ok 6 - Server exited cleanly
    # Looks like you failed 1 test of 6

afstest_StopServer has a check for the process terminating with signal
15 (SIGTERM), but not for the process exiting with code 15.

Change-Id: I022965ea2b5440486ea1cf562551d3bbd0516104
Reviewed-on: https://gerrit.openafs.org/12489
Tested-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/opr/softsig.c

index 4a210ad..469bd43 100644 (file)
@@ -82,6 +82,13 @@ signalHandler(void *arg)
 static void
 ExitHandler(int signal)
 {
+    sigset_t set;
+    sigemptyset(&set);
+    sigaddset(&set, signal);
+    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+    raise(signal);
+
+    /* Should be unreachable. */
     exit(signal);
 }