summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_poll.c
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>1999-08-19 23:06:11 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>1999-08-19 23:06:11 +0000
commit91518882e0644ea4047cdeffbed637e857906caa (patch)
treeb10bd9f64c914d3351cce2d7847b7bc1f73b2c5a /lib/libpthread/thread/thr_poll.c
parentd3c6699913165313c0a4b2a03e7e068ede6c7384 (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_poll.c')
-rw-r--r--lib/libpthread/thread/thr_poll.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_poll.c b/lib/libpthread/thread/thr_poll.c
index a54d0236f5f6..2acd725dea5f 100644
--- a/lib/libpthread/thread/thr_poll.c
+++ b/lib/libpthread/thread/thr_poll.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: uthread_poll.c,v 1.1 1999/06/20 08:28:36 jb Exp $
*/
#include <unistd.h>
#include <errno.h>
@@ -58,13 +58,16 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout)
if (timeout == INFTIM) {
/* Wait for ever: */
_thread_kern_set_timeout(NULL);
- } else if (timeout != 0) {
+ } else if (timeout > 0) {
/* Convert the timeout in msec to a timespec: */
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout % 1000) * 1000;
/* Set the wake up time: */
_thread_kern_set_timeout(&ts);
+ } else if (timeout < 0) {
+ /* a timeout less than zero but not == INFTIM is invalid */
+ return (EINVAL);
}
if (((ret = _thread_sys_poll(fds, numfds, 0)) == 0) && (timeout != 0)) {