mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
Kernel: If a process is interrupted during usleep(), return -EINTR
This commit is contained in:
@@ -1514,12 +1514,9 @@ int Process::sys$usleep(useconds_t usec)
|
||||
{
|
||||
if (!usec)
|
||||
return 0;
|
||||
|
||||
u64 wakeup_time = current->sleep(usec / 1000);
|
||||
if (wakeup_time > g_uptime) {
|
||||
u32 ticks_left_until_original_wakeup_time = wakeup_time - g_uptime;
|
||||
return ticks_left_until_original_wakeup_time / TICKS_PER_SECOND;
|
||||
}
|
||||
if (wakeup_time > g_uptime)
|
||||
return -EINTR;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user