diff options
author | 2009-12-14 05:10:13 +0000 | |
---|---|---|
committer | 2009-12-14 05:10:13 +0000 | |
commit | 0033679bd91762b84e5e4009e40f471a37a73ecf (patch) | |
tree | 0e4ddd0d5c948aa288b5355d724deaad4137da97 /lib/libc | |
parent | Add a test for sleep(3), to verify that it both (a) returns zero when it (diff) | |
download | wireguard-openbsd-0033679bd91762b84e5e4009e40f471a37a73ecf.tar.xz wireguard-openbsd-0033679bd91762b84e5e4009e40f471a37a73ecf.zip |
sleep(3) is supposed to return zero when it sleeps the entire amount
ok deraadt@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/sleep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c index 28e9657a9ee..767f62d1616 100644 --- a/lib/libc/gen/sleep.c +++ b/lib/libc/gen/sleep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sleep.c,v 1.11 2005/08/08 08:05:34 espie Exp $ */ +/* $OpenBSD: sleep.c,v 1.12 2009/12/14 05:10:13 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -42,8 +42,8 @@ sleep(unsigned int seconds) rqt.tv_sec = seconds; rqt.tv_nsec = 0; - if (nanosleep(&rqt, &rmt) < 0) - ; + if (nanosleep(&rqt, &rmt) == 0) + rmt.tv_sec = 0; return(rmt.tv_sec); } |