poll_wrapper: use the actual correct timeout for ppoll

It's not absolute time. Fixes #12660.
This commit is contained in:
Dudemanguy 2023-10-17 09:47:30 -05:00
parent 4a46e4ee02
commit b8950f8d95
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@
int mp_poll(struct pollfd *fds, int nfds, int64_t timeout_ns)
{
#if HAVE_PPOLL
struct timespec ts = mp_time_ns_to_realtime(timeout_ns);
struct timespec ts;
ts.tv_sec = timeout_ns / UINT64_C(1000000000);
ts.tv_nsec = timeout_ns % UINT64_C(1000000000);
return ppoll(fds, nfds, &ts, NULL);
#endif
return poll(fds, nfds, timeout_ns / 1e6);