1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

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

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);
}