summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-06 21:01:44 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-06 21:01:44 +0100
commit2c693094d9717aac2a6f4cfd3d36aca9608e6045 (patch)
treec9480a2ba0f76f7aad9ec83662085fc98ef72297
parentac2cc7d78fed7ef69df529f230d39e12afe7e4ef (diff)
downloadserenity-2c693094d9717aac2a6f4cfd3d36aca9608e6045.zip
Kernel: If a process is interrupted during usleep(), return -EINTR
-rw-r--r--Kernel/Process.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index e41b40cf04..d0ec3c26d4 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -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;
}