Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/syscall Don't depend on the atf timeout stuff, do it o...
details: https://anonhg.NetBSD.org/src/rev/6f37c7bc0ed5
branches: trunk
changeset: 765064:6f37c7bc0ed5
user: christos <christos%NetBSD.org@localhost>
date: Wed May 18 03:15:12 2011 +0000
description:
Don't depend on the atf timeout stuff, do it ourselves.
diffstat:
tests/syscall/t_pselect.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (38 lines):
diff -r dff873ebefe7 -r 6f37c7bc0ed5 tests/syscall/t_pselect.c
--- a/tests/syscall/t_pselect.c Wed May 18 03:07:37 2011 +0000
+++ b/tests/syscall/t_pselect.c Wed May 18 03:15:12 2011 +0000
@@ -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;
+ }
}
}
Home |
Main Index |
Thread Index |
Old Index