diff options
author | bde <bde@FreeBSD.org> | 1997-11-20 15:13:20 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-11-20 15:13:20 +0000 |
commit | ea4fadd3114a6a93d5e0d33154dc3e7081b31833 (patch) | |
tree | 8ec1040f090ee718b75cb5cebce3f935ab71f999 /lib/libc/gen/usleep.c | |
parent | 9eee7eb270fef77617e71de7dbe595105ac78277 (diff) | |
download | FreeBSD-src-ea4fadd3114a6a93d5e0d33154dc3e7081b31833.zip FreeBSD-src-ea4fadd3114a6a93d5e0d33154dc3e7081b31833.tar.gz |
Don't check for the unlikely case of useconds == 0 here. The kernel
checks it.
Fixed a style bug.
Diffstat (limited to 'lib/libc/gen/usleep.c')
-rw-r--r-- | lib/libc/gen/usleep.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c index d2d4f1e..4abe291 100644 --- a/lib/libc/gen/usleep.c +++ b/lib/libc/gen/usleep.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93"; #endif static char rcsid[] = - "$Id: usleep.c,v 1.20 1997/10/22 10:55:49 ache Exp $"; + "$Id: usleep.c,v 1.21 1997/10/22 12:04:49 ache Exp $"; #endif /* LIBC_SCCS and not lint */ #include <time.h> @@ -48,10 +48,7 @@ usleep(useconds) { struct timespec time_to_sleep; - if (useconds) { - time_to_sleep.tv_nsec = (useconds % 1000000) * 1000; - time_to_sleep.tv_sec = useconds / 1000000; - return nanosleep(&time_to_sleep, NULL); - } - return 0; + time_to_sleep.tv_nsec = (useconds % 1000000) * 1000; + time_to_sleep.tv_sec = useconds / 1000000; + return (nanosleep(&time_to_sleep, NULL)); } |