summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2002-01-10 00:38:39 +0000
committerfgsch <fgsch@openbsd.org>2002-01-10 00:38:39 +0000
commit2af87bf9079502958c2b4773a328e8f9a5b38003 (patch)
treec09bb4eae656b7d246533a4551c9004956dd03cd /lib/libpthread
parentCheck result from malloc(9) when using M_NOWAIT. hugh@ ok (diff)
downloadwireguard-openbsd-2af87bf9079502958c2b4773a328e8f9a5b38003.tar.xz
wireguard-openbsd-2af87bf9079502958c2b4773a328e8f9a5b38003.zip
From FreeBSD: fix conversion from msec to timespec.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_poll.c6
1 files changed, 3 insertions, 3 deletions
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);
}