From: Anders Kaseorg Date: Wed, 14 Dec 2016 22:52:35 +0000 (-0500) Subject: opr: ExitHandler: re-raise the signal instead of exiting with that code X-Git-Tag: upstream/1.8.0_pre2^3~78 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=eb7d3ac4bbd30fc31741cea74fe2b23577deb61e;p=packages%2Fo%2Fopenafs.git opr: ExitHandler: re-raise the signal instead of exiting with that code 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 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk --- diff --git a/src/opr/softsig.c b/src/opr/softsig.c index 4a210ad65..469bd43e1 100644 --- a/src/opr/softsig.c +++ b/src/opr/softsig.c @@ -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); }