Module Name:    src
Committed By:   christos
Date:           Wed May 18 03:15:12 UTC 2011

Modified Files:
        src/tests/syscall: t_pselect.c

Log Message:
Don't depend on the atf timeout stuff, do it ourselves.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/syscall/t_pselect.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/syscall/t_pselect.c
diff -u src/tests/syscall/t_pselect.c:1.1 src/tests/syscall/t_pselect.c:1.2
--- src/tests/syscall/t_pselect.c:1.1	Tue May 17 22:57:48 2011
+++ src/tests/syscall/t_pselect.c	Tue May 17 23:15:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pselect.c,v 1.1 2011/05/18 02:57:48 christos Exp $ */
+/*	$NetBSD: t_pselect.c,v 1.2 2011/05/18 03:15:12 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -92,7 +92,6 @@
 	/* Cf. PR lib/43625. */
 	atf_tc_set_md_var(tc, "descr",
 	    "Checks pselect's temporary mask setting");
-	atf_tc_set_md_var(tc, "timeout", "2");
 }
 
 ATF_TC_BODY(pselect_signal_mask, tc)
@@ -109,9 +108,18 @@
 		usleep(500);
 		if (kill(pid, SIGTERM) == -1)
 			err(1, "kill");
-		if (waitpid(pid, &status, 0) == -1)
+		usleep(500);
+		switch (waitpid(pid, &status, WNOHANG)) {
+		case -1:
 			err(1, "wait");
-		break;
+		case 0:
+			if (kill(pid, SIGKILL) == -1)
+				err(1, "kill");
+			atf_tc_fail("pselect() did not receive signal");
+			break;
+		default:
+			break;
+		}
 	}
 }
 

Reply via email to