summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/sys/t_getitimer.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/regress/lib/libc/sys/t_getitimer.c15
1 files changed, 9 insertions, 6 deletions
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 @@
1/* $OpenBSD: t_getitimer.c,v 1.1.1.1 2019/11/19 19:57:03 bluhm Exp $ */ 1/* $OpenBSD: t_getitimer.c,v 1.2 2019/11/22 15:59:53 bluhm Exp $ */
2/* $NetBSD: t_getitimer.c,v 1.2 2012/03/22 18:20:46 christos Exp $ */ 2/* $NetBSD: t_getitimer.c,v 1.3 2019/07/13 12:44:02 gson Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2011 The NetBSD Foundation, Inc. 5 * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -179,11 +179,13 @@ ATF_TC_BODY(setitimer_old, tc)
179 struct itimerval it, ot; 179 struct itimerval it, ot;
180 180
181 /* 181 /*
182 * Make two calls; the second one 182 * Make two calls; the second one should store the old
183 * should store the old values. 183 * timer value which should be the same as that set in
184 * the first call, or slightly less due to time passing
185 * between the two calls.
184 */ 186 */
185 it.it_value.tv_sec = 4; 187 it.it_value.tv_sec = 4;
186 it.it_value.tv_usec = 3; 188 it.it_value.tv_usec = 999999;
187 189
188 it.it_interval.tv_sec = 0; 190 it.it_interval.tv_sec = 0;
189 it.it_interval.tv_usec = 0; 191 it.it_interval.tv_usec = 0;
@@ -198,7 +200,8 @@ ATF_TC_BODY(setitimer_old, tc)
198 200
199 ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0); 201 ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0);
200 202
201 if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3) 203 /* Check seconds only as microseconds may have decremented */
204 if (ot.it_value.tv_sec != 4)
202 atf_tc_fail("setitimer(2) did not store old values"); 205 atf_tc_fail("setitimer(2) did not store old values");
203} 206}
204 207