summaryrefslogtreecommitdiff
path: root/test/test-skeleton.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-24 21:58:57 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-24 21:58:57 +0000
commitd3b74921b9b1a46deab7fc4cc540fbaff91ebca3 (patch)
tree7ea0aaa234029a4ce78f07e61091ba742a60a409 /test/test-skeleton.c
parentae91936353df4d1ce8dfbe5d37e729ef85d0b1b2 (diff)
test/Makefile: make "make compile" install headers first
test/regex/Makefile: remove superfluous oprions test/regex/tst-regex2.c: reformat, simplify, and make error messages more informative test/test-skeleton.c: kill child test process on ^C
Diffstat (limited to 'test/test-skeleton.c')
-rw-r--r--test/test-skeleton.c14
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. */