summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-01-10 00:38:40 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-01-10 00:38:40 +0000
commitb80ea47ce71a5c6ecddd3a6937f0f1f7c01ba24e (patch)
tree136c9960f1e06612c20a9bacddd63360b48577f4 /lib
parent4415d12cf360370d4f92c85f6e8cf8a57f7ed1e5 (diff)
From FreeBSD: fix conversion from msec to timespec.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc_r/uthread/uthread_poll.c6
-rw-r--r--lib/libpthread/uthread/uthread_poll.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_poll.c b/lib/libc_r/uthread/uthread_poll.c
index 6119eda2f34..cb6915fbd36 100644
--- a/lib/libc_r/uthread/uthread_poll.c
+++ b/lib/libc_r/uthread/uthread_poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_poll.c,v 1.6 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_poll.c,v 1.7 2002/01/10 00:38:39 fgsch Exp $ */
/*
* Copyright (c) 1999 Daniel Eischen <eischen@vigrid.com>
* All rights reserved.
@@ -63,12 +63,12 @@ poll(struct pollfd fds[], int nfds, int timeout)
} else if (timeout > 0) {
/* Convert the timeout in msec to a timespec: */
ts.tv_sec = timeout / 1000;
- ts.tv_nsec = (timeout % 1000) * 1000;
+ ts.tv_nsec = (timeout % 1000) * 1000000;
/* Set the wake up time: */
_thread_kern_set_timeout(&ts);
} else if (timeout < 0) {
- /* a timeout less than zero but not == -1 is invalid */
+ /* a timeout less than zero but not == INFTIM is invalid */
errno = EINVAL;
return (-1);
}
diff --git a/lib/libpthread/uthread/uthread_poll.c b/lib/libpthread/uthread/uthread_poll.c
index 6119eda2f34..cb6915fbd36 100644
--- a/lib/libpthread/uthread/uthread_poll.c
+++ b/lib/libpthread/uthread/uthread_poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_poll.c,v 1.6 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_poll.c,v 1.7 2002/01/10 00:38:39 fgsch Exp $ */
/*
* Copyright (c) 1999 Daniel Eischen <eischen@vigrid.com>
* All rights reserved.
@@ -63,12 +63,12 @@ poll(struct pollfd fds[], int nfds, int timeout)
} else if (timeout > 0) {
/* Convert the timeout in msec to a timespec: */
ts.tv_sec = timeout / 1000;
- ts.tv_nsec = (timeout % 1000) * 1000;
+ ts.tv_nsec = (timeout % 1000) * 1000000;
/* Set the wake up time: */
_thread_kern_set_timeout(&ts);
} else if (timeout < 0) {
- /* a timeout less than zero but not == -1 is invalid */
+ /* a timeout less than zero but not == INFTIM is invalid */
errno = EINVAL;
return (-1);
}