Correct calculation of tv_nsec in poll().

This commit is contained in:
Darren Tucker 2021-11-18 23:44:07 +11:00
parent 21dd5a9a3f
commit d902d728df
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ poll(struct pollfd *fds, nfds_t nfds, int timeout)
/* poll timeout is msec, ppoll is timespec (sec + nsec) */ /* poll timeout is msec, ppoll is timespec (sec + nsec) */
if (timeout >= 0) { if (timeout >= 0) {
ts.tv_sec = timeout / 1000; ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout % 1000000) * 1000000; ts.tv_nsec = (timeout % 1000) * 1000000;
tsp = &ts; tsp = &ts;
} }