From d669dd49d65471c09a4211ff686aeda0d2bb7abf Mon Sep 17 00:00:00 2001 From: bluhm <> Date: Fri, 22 Nov 2019 15:59:53 +0000 Subject: Sync tests with current NetBSD. Enable t_mkfifo test. from Moritz Buhl --- src/regress/lib/libc/sys/t_getitimer.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/regress/lib/libc/sys/t_getitimer.c') diff --git a/src/regress/lib/libc/sys/t_getitimer.c b/src/regress/lib/libc/sys/t_getitimer.c index b6cc4102bb..fbf9c28ccc 100644 --- a/src/regress/lib/libc/sys/t_getitimer.c +++ b/src/regress/lib/libc/sys/t_getitimer.c @@ -1,5 +1,5 @@ -/* $OpenBSD: t_getitimer.c,v 1.1.1.1 2019/11/19 19:57:03 bluhm Exp $ */ -/* $NetBSD: t_getitimer.c,v 1.2 2012/03/22 18:20:46 christos Exp $ */ +/* $OpenBSD: t_getitimer.c,v 1.2 2019/11/22 15:59:53 bluhm Exp $ */ +/* $NetBSD: t_getitimer.c,v 1.3 2019/07/13 12:44:02 gson Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -179,11 +179,13 @@ ATF_TC_BODY(setitimer_old, tc) struct itimerval it, ot; /* - * Make two calls; the second one - * should store the old values. + * Make two calls; the second one should store the old + * timer value which should be the same as that set in + * the first call, or slightly less due to time passing + * between the two calls. */ it.it_value.tv_sec = 4; - it.it_value.tv_usec = 3; + it.it_value.tv_usec = 999999; it.it_interval.tv_sec = 0; it.it_interval.tv_usec = 0; @@ -198,7 +200,8 @@ ATF_TC_BODY(setitimer_old, tc) ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0); - if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3) + /* Check seconds only as microseconds may have decremented */ + if (ot.it_value.tv_sec != 4) atf_tc_fail("setitimer(2) did not store old values"); } -- cgit v1.2.3-55-g6feb