diff options
Diffstat (limited to 'test/test-skeleton.c')
-rw-r--r-- | test/test-skeleton.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test-skeleton.c b/test/test-skeleton.c index adfc8b75b..c61d09e82 100644 --- a/test/test-skeleton.c +++ b/test/test-skeleton.c @@ -190,6 +190,16 @@ timeout_handler (int sig __attribute__ ((unused))) exit (1); } +static void +__attribute__ ((noreturn)) +handler_killpid(int sig) +{ + kill(pid, SIGKILL); /* kill test */ + signal(sig, SIG_DFL); + raise(sig); /* kill ourself */ + _exit(128 + sig); /* paranoia */ +} + /* We provide the entry point here. */ int main (int argc, char *argv[]) @@ -332,6 +342,10 @@ main (int argc, char *argv[]) exit (1); } + signal (SIGTERM, handler_killpid); + signal (SIGINT, handler_killpid); + signal (SIGQUIT, handler_killpid); + /* Set timeout. */ #ifndef TIMEOUT /* Default timeout is two seconds. */ |