summaryrefslogtreecommitdiff
path: root/lib/libc/gen/sleep.c
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-12-14 05:10:14 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-12-14 05:10:14 +0000
commit4f29ba361a543816a07422023936c6be051fb114 (patch)
tree9083bb0fe5128e9041b537dfe74e35a764a03489 /lib/libc/gen/sleep.c
parenta5f1ed8ddd11a952231e563d1907e532da3d113f (diff)
sleep(3) is supposed to return zero when it sleeps the entire amount
ok deraadt@
Diffstat (limited to 'lib/libc/gen/sleep.c')
-rw-r--r--lib/libc/gen/sleep.c6
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);
}