Fix poll(2) timeout not being miliseconds.

This commit is contained in:
Jonas 'Sortie' Termansen 2015-05-22 19:52:57 +02:00
parent 2291076f19
commit 8d89a6f8ad
1 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@
extern "C" int poll(struct pollfd* fds, nfds_t nfds, int timeout)
{
struct timespec ts;
ts.tv_sec = timeout;
ts.tv_nsec = 0;
return ppoll(fds, nfds, &ts, NULL);
ts.tv_sec = timeout / 1000;
ts.tv_nsec = timeout % 1000;
return ppoll(fds, nfds, timeout < 0 ? NULL : &ts, NULL);
}