libc: fix returned timeout-left value

If the suspend method for the main thread detects that the suspend
condition is false it must return the passed timeout value (not always
0). Otherwise, the caller may incorrectly assume the timeout expired.
This commit is contained in:
Christian Helmuth 2020-01-28 18:42:12 +01:00
parent 2a94f8cdb4
commit 43719b5fd1
1 changed files with 1 additions and 1 deletions

View File

@ -291,7 +291,7 @@ struct Libc::Kernel final : Vfs::Io_response_handler,
}
if (!check.suspend() && !_kernel_routine)
return 0;
return timeout_ms;
if (timeout_ms > 0)
_main_timeout.timeout(timeout_ms);