summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_poll.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>1999-08-30 00:02:08 +0000
committerdeischen <deischen@FreeBSD.org>1999-08-30 00:02:08 +0000
commit4bef5403f8a8fe0787101f3f5a555262f3d70b41 (patch)
treea6269f3d35c3d1224512aacadcf0b43891497dc0 /lib/libpthread/thread/thr_poll.c
parent48597b2c18bfeb35efb00c8b6071da5e92baf996 (diff)
downloadFreeBSD-src-4bef5403f8a8fe0787101f3f5a555262f3d70b41.zip
FreeBSD-src-4bef5403f8a8fe0787101f3f5a555262f3d70b41.tar.gz
When checking for valid timevals in the wrapped select() and poll()
routines, don't return EINVAL but set errno to EINVAL and return -1. Added a check in pthread_cond_timedwait for a null timespec pointer.
Diffstat (limited to 'lib/libpthread/thread/thr_poll.c')
-rw-r--r--lib/libpthread/thread/thr_poll.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_poll.c b/lib/libpthread/thread/thr_poll.c
index 4967e6c..01916ad 100644
--- a/lib/libpthread/thread/thr_poll.c
+++ b/lib/libpthread/thread/thr_poll.c
@@ -67,7 +67,8 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout)
_thread_kern_set_timeout(&ts);
} else if (timeout < 0) {
/* a timeout less than zero but not == INFTIM is invalid */
- return (EINVAL);
+ errno = EINVAL;
+ return (-1);
}
if (((ret = _thread_sys_poll(fds, numfds, 0)) == 0) && (timeout != 0)) {
OpenPOWER on IntegriCloud