Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/rump/rumpkern/h_client check that we actually go into ...



details:   https://anonhg.NetBSD.org/src/rev/343087c002a2
branches:  trunk
changeset: 760673:343087c002a2
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Jan 10 19:30:21 2011 +0000

description:
check that we actually go into the signal handler

diffstat:

 tests/rump/rumpkern/h_client/h_sigcli.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r 618077520361 -r 343087c002a2 tests/rump/rumpkern/h_client/h_sigcli.c
--- a/tests/rump/rumpkern/h_client/h_sigcli.c   Mon Jan 10 18:35:49 2011 +0000
+++ b/tests/rump/rumpkern/h_client/h_sigcli.c   Mon Jan 10 19:30:21 2011 +0000
@@ -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");
+       }
 }



Home | Main Index | Thread Index | Old Index