diff options
| author | Patrick Mooney <pmooney@pfmooney.com> | 2016-02-16 20:57:14 +0000 |
|---|---|---|
| committer | Patrick Mooney <pmooney@pfmooney.com> | 2016-02-16 22:31:17 +0000 |
| commit | 32a24289da9b634ae9e90d4f7f6b6501fa2cc915 (patch) | |
| tree | 593fdbc66fd55cddd69760319024c47e6e7f3853 | |
| parent | a806978df3df8db8cf3ebbbb61cc7bce25d1ebc7 (diff) | |
| download | illumos-joyent-32a24289da9b634ae9e90d4f7f6b6501fa2cc915.tar.gz | |
OS-5162 poll/select yield improper EINTR when nfds and timeout are 0
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
| -rw-r--r-- | usr/src/uts/common/syscall/poll.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/src/uts/common/syscall/poll.c b/usr/src/uts/common/syscall/poll.c index ba918759c8..3d0a5cc04b 100644 --- a/usr/src/uts/common/syscall/poll.c +++ b/usr/src/uts/common/syscall/poll.c @@ -29,7 +29,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. - * Copyright 2015, Joyent, Inc. + * Copyright 2016, Joyent, Inc. */ /* @@ -390,6 +390,7 @@ poll_common(pollstate_t *ps, pollfd_t *fds, nfds_t nfds, timespec_t *tsp, * If yes then bypass all the other stuff and make him sleep. */ if (nfds == 0) { + *fdcnt = 0; /* * Sleep until we have passed the requested future * time or until interrupted by a signal. @@ -401,9 +402,9 @@ poll_common(pollstate_t *ps, pollfd_t *fds, nfds_t nfds, timespec_t *tsp, &t->t_delay_lock, deadline)) > 0) continue; mutex_exit(&t->t_delay_lock); + return ((error == 0) ? EINTR : 0); } - *fdcnt = 0; - return ((error == 0) ? EINTR : 0); + return (0); } VERIFY(ps != NULL); |
