From: Roland McGrath Date: Tue, 19 Oct 1999 17:53:26 +0000 (+0000) Subject: 1999-10-19 Bruno Haible X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95688720e89a889daf11d061a968f179d5d56d90;p=thirdparty%2Fglibc.git 1999-10-19 Bruno Haible * sysdeps/mach/sleep.c (__sleep): If we slept longer than requested, return 0, not UINT_MAX. --- diff --git a/sysdeps/mach/sleep.c b/sysdeps/mach/sleep.c index 7d044129685..7088b43d96b 100644 --- a/sysdeps/mach/sleep.c +++ b/sysdeps/mach/sleep.c @@ -31,6 +31,7 @@ __sleep (unsigned int seconds) { time_t before, after; mach_port_t recv; + unsigned int slept; recv = __mach_reply_port (); @@ -40,6 +41,7 @@ __sleep (unsigned int seconds) after = time ((time_t *) NULL); __mach_port_destroy (__mach_task_self (), recv); - return seconds - (after - before); + slept = after - before; + return (slept <= seconds ? seconds - slept : 0); } weak_alias (__sleep, sleep)