summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-09 00:29:15 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-09 00:29:15 +0000
commitab530243970094e42e9ccbc902e964efae1a5f7b (patch)
treed7c10061fd0f48a08de7495cd65e4feb57ae9710 /test
parent1ff4b6bb11233ec1fb0a65a1327c23622794b1ce (diff)
make sure the call to signal() worked
Diffstat (limited to 'test')
-rw-r--r--test/signal/signal.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/signal/signal.c b/test/signal/signal.c
index abe211109..97963ebda 100644
--- a/test/signal/signal.c
+++ b/test/signal/signal.c
@@ -70,14 +70,20 @@ void signal_test_1(void)
global_int = 0;
it = "global variable set from signal handler";
- signal(SIGUSR1, set_global_int_to_one);
+ if (signal(SIGUSR1, set_global_int_to_one) == SIG_ERR) {
+ perror("signal(SIGUSR1) failed");
+ exit(-1);
+ }
raise(SIGUSR1);
/* This should already have jumped to the signal handler */
check((global_int == 1), 1);
global_int = 0;
- signal(SIGUSR1, SIG_IGN);
+ if (signal(SIGUSR1, SIG_IGN) == SIG_ERR) {
+ perror("signal(SIGUSR1) failed");
+ exit(-1);
+ }
raise(SIGUSR1);
/* This should not go to the signal handler this time since we */
check((global_int == 0), 1);