mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-23 02:45:29 +00:00
os: fix cond timed wait crash on large timeout
This commit is contained in:
parent
bdb604cc45
commit
c263a29b52
|
@ -469,8 +469,9 @@ void soundio_os_cond_timed_wait(struct SoundIoOsCond *cond,
|
|||
|
||||
// this time is relative
|
||||
struct timespec timeout;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_nsec = (seconds * 1000000000L);
|
||||
timeout.tv_sec = timeout.tv_nsec / 1000000000L;
|
||||
timeout.tv_nsec = timeout.tv_nsec % 1000000000L;
|
||||
|
||||
if (kevent(cond->kq_id, &kev, 1, &out_kev, 1, &timeout) == -1) {
|
||||
if (errno == EINTR)
|
||||
|
|
Loading…
Reference in a new issue