summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-05-25 18:34:46 +0000
committerMike Frysinger <vapier@gentoo.org>2007-05-25 18:34:46 +0000
commitdc542b5742da70098945177e530f9ac54653a419 (patch)
tree7f98e886f7a727c55529d484661f29fa7c005686
parent7dfbb9a92900ae20453b8fb8f18cfe33f7a9d5c7 (diff)
Jean-Christian de Rivaz writes:
I actually suspect this code into the file uClibc/libc/sysdeps/linux/common/poll.c: tval.tv_nsec = (timeout % 1000) *1000; <==== make only usec! From milisecond this really needs a * 1000000 to make nanosecond. Without this a 1100 milisecond timeout is converted into a 1 seconde and 100 microsecond timeout! This can explain the weird result of the test code.
-rw-r--r--libc/sysdeps/linux/common/poll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c
index a8366cd27..4fc5a3267 100644
--- a/libc/sysdeps/linux/common/poll.c
+++ b/libc/sysdeps/linux/common/poll.c
@@ -36,7 +36,7 @@ int __libc_poll(struct pollfd *fds, nfds_t nfds, int timeout)
struct timespec *ts = NULL, tval;
if (timeout > 0) {
tval.tv_sec = timeout / 1000;
- tval.tv_nsec = (timeout % 1000) *1000;
+ tval.tv_nsec = (timeout % 1000) * 1000000;
ts = &tval;
}
return ppoll(fds, nfds, ts, NULL);