Message ID | 20240825013816.414609-1-samuel.thibault@ens-lyon.org |
---|---|
State | New |
Headers | show |
Series | [hurd,commited] mach: Fix bogus negative return | expand |
diff --git a/sysdeps/mach/sleep.c b/sysdeps/mach/sleep.c index 572be150bc..aa750c13c5 100644 --- a/sysdeps/mach/sleep.c +++ b/sysdeps/mach/sleep.c @@ -43,6 +43,9 @@ __sleep (unsigned int seconds) after = time_now (); __mach_port_destroy (__mach_task_self (), recv); + if (after - before > seconds) + return 0; + return seconds - (after - before); } weak_alias (__sleep, sleep)