diff options
author | jb <jb@FreeBSD.org> | 1998-09-05 08:01:26 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-09-05 08:01:26 +0000 |
commit | 53450eb3448e9b9744bb31c0fcecd23b5b4137f1 (patch) | |
tree | 2e81fc00dd11a79dc1219cb22a0346f07cc9ed1a /lib/libc/gen/sleep.c | |
parent | ee52c4c5c01690165e86f18f0ab467acf6ee81df (diff) | |
download | FreeBSD-src-53450eb3448e9b9744bb31c0fcecd23b5b4137f1.zip FreeBSD-src-53450eb3448e9b9744bb31c0fcecd23b5b4137f1.tar.gz |
Use INT_MAX instead of LONG_MAX since the variable being compared
is an int, not a long.
Diffstat (limited to 'lib/libc/gen/sleep.c')
-rw-r--r-- | lib/libc/gen/sleep.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c index 5789647..898ff1c 100644 --- a/lib/libc/gen/sleep.c +++ b/lib/libc/gen/sleep.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93"; #endif static char rcsid[] = - "$Id$"; + "$Id: sleep.c,v 1.22 1997/10/17 09:35:50 ache Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -53,10 +53,10 @@ sleep(seconds) /* * Avoid overflow when `seconds' is huge. This assumes that - * the maximum value for a time_t is >= LONG_MAX. + * the maximum value for a time_t is >= INT_MAX. */ - if (seconds > LONG_MAX) - return (seconds - LONG_MAX + sleep(LONG_MAX)); + if (seconds > INT_MAX) + return (seconds - INT_MAX + sleep(INT_MAX)); time_to_sleep.tv_sec = seconds; time_to_sleep.tv_nsec = 0; |