summaryrefslogtreecommitdiff
path: root/lib/libc_r/TEST
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>2000-01-06 06:55:14 +0000
committerDavid Leonard <d@cvs.openbsd.org>2000-01-06 06:55:14 +0000
commit5d832056d1aaca8b33281fccbcceb705bb2e6e91 (patch)
tree1d16c5fe54f70a288894f222a420b28e34654499 /lib/libc_r/TEST
parent845f14c06abfca479ea802515dd587fc8ef16918 (diff)
cleanup
Diffstat (limited to 'lib/libc_r/TEST')
-rw-r--r--lib/libc_r/TEST/test_pause.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/libc_r/TEST/test_pause.c b/lib/libc_r/TEST/test_pause.c
index ab71982d7d6..be27ac8af50 100644
--- a/lib/libc_r/TEST/test_pause.c
+++ b/lib/libc_r/TEST/test_pause.c
@@ -1,21 +1,34 @@
+/* $OpenBSD: test_pause.c,v 1.3 2000/01/06 06:55:13 d Exp $ */
+/*
+ * Test pause()
+ */
#include <stdio.h>
#include <signal.h>
#include <string.h>
+#include <unistd.h>
#include "test.h"
-foo(int sig)
+int gotsig = 0;
+
+void
+handler(sig)
+ int sig;
{
printf("%s\n", strsignal(sig));
- return;
}
+int
main()
{
sigset_t all;
+ pid_t self;
- CHECKe(signal(1, foo));
- CHECKe(sigfillset(&all));
+ ASSERT(signal(SIGHUP, handler) != SIG_ERR);
+ CHECKe(self = getpid());
+ CHECKe(sigemptyset(&all));
+ CHECKe(sigaddset(&all, SIGHUP));
CHECKe(sigprocmask(SIG_BLOCK, &all, NULL));
+ CHECKe(kill(self, SIGHUP));
CHECKe(pause());
SUCCEED;
}