kernel: Check != not < B_INFINITE_TIMEOUT.
As it's INT64_MAX, so anything "larger" is really overflowed into negative.
This commit is contained in:
@@ -51,7 +51,7 @@ syscall_restart_handle_timeout_pre(uint32& flags, bigtime_t& timeout)
|
||||
if (timeout > 0 && (flags & B_RELATIVE_TIMEOUT) != 0)
|
||||
flags = (flags & ~B_RELATIVE_TIMEOUT) | B_ABSOLUTE_TIMEOUT;
|
||||
} else if ((flags & B_RELATIVE_TIMEOUT) != 0) {
|
||||
if (timeout > 0 && timeout < B_INFINITE_TIMEOUT) {
|
||||
if (timeout > 0 && timeout != B_INFINITE_TIMEOUT) {
|
||||
timeout += system_time();
|
||||
// deal with overflow
|
||||
if (timeout < 0)
|
||||
|
||||
@@ -2963,7 +2963,7 @@ thread_block_with_timeout(uint32 timeoutFlags, bigtime_t timeout)
|
||||
return thread->wait.status;
|
||||
|
||||
bool useTimer = (timeoutFlags & (B_RELATIVE_TIMEOUT | B_ABSOLUTE_TIMEOUT)) != 0
|
||||
&& timeout < B_INFINITE_TIMEOUT;
|
||||
&& timeout != B_INFINITE_TIMEOUT;
|
||||
|
||||
if (useTimer) {
|
||||
// Timer flags: absolute/relative.
|
||||
|
||||
Reference in New Issue
Block a user