Fix poll(2) timeout not being miliseconds.
This commit is contained in:
parent
2291076f19
commit
8d89a6f8ad
|
@ -28,7 +28,7 @@
|
||||||
extern "C" int poll(struct pollfd* fds, nfds_t nfds, int timeout)
|
extern "C" int poll(struct pollfd* fds, nfds_t nfds, int timeout)
|
||||||
{
|
{
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
ts.tv_sec = timeout;
|
ts.tv_sec = timeout / 1000;
|
||||||
ts.tv_nsec = 0;
|
ts.tv_nsec = timeout % 1000;
|
||||||
return ppoll(fds, nfds, &ts, NULL);
|
return ppoll(fds, nfds, timeout < 0 ? NULL : &ts, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue