Module Name:    src
Committed By:   pooka
Date:           Mon Jan 10 19:30:22 UTC 2011

Modified Files:
        src/tests/rump/rumpkern/h_client: h_sigcli.c

Log Message:
check that we actually go into the signal handler


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/rump/rumpkern/h_client/h_sigcli.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/rump/rumpkern/h_client/h_sigcli.c
diff -u src/tests/rump/rumpkern/h_client/h_sigcli.c:1.1 src/tests/rump/rumpkern/h_client/h_sigcli.c:1.2
--- src/tests/rump/rumpkern/h_client/h_sigcli.c:1.1	Thu Jan  6 07:00:28 2011
+++ src/tests/rump/rumpkern/h_client/h_sigcli.c	Mon Jan 10 19:30:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_sigcli.c,v 1.1 2011/01/06 07:00:28 pooka Exp $	*/
+/*	$NetBSD: h_sigcli.c,v 1.2 2011/01/10 19:30:21 pooka Exp $	*/
 
 #include <sys/types.h>
 #include <sys/sysctl.h>
@@ -15,6 +15,8 @@
 static const int hostnamemib[] = { CTL_KERN, KERN_HOSTNAME };
 static char hostnamebuf[128];
 
+static volatile sig_atomic_t sigexecs;
+
 static void
 sighand(int sig)
 {
@@ -26,6 +28,7 @@
 		err(1, "sighand sysctl");
 	if (strcmp(buf, hostnamebuf) != 0)
 		errx(1, "sighandler hostname");
+	sigexecs++;
 }
 
 int
@@ -62,4 +65,8 @@
 		if (strcmp(buf, hostnamebuf) != 0)
 			errx(1, "main hostname");
 	}
+
+	if (!sigexecs) {
+		printf("no signal handlers run.  test busted?\n");
+	}
 }

Reply via email to