diff options
author | Chen Jie <chenj@lemote.com> | 2013-09-12 09:21:41 +0800 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-01 04:49:59 +0200 |
commit | c22ceead439fbd7825acb14b5db904851d0389ef (patch) | |
tree | 35e603ec996df9fdab1716b0ce1b8cce5b4322dd | |
parent | e6dca814412f17db05910acedf76d36d3b7f1355 (diff) |
util.c: ignore pollfd.revent for loop_read/loop_write
Let read()/write() report any error/EOF.
-rw-r--r-- | src/shared/util.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index fb42d663a6..5dc605eb8d 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -2186,8 +2186,10 @@ ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) { return n > 0 ? n : -errno; } - if (pollfd.revents != POLLIN) - return n > 0 ? n : -EIO; + /* We knowingly ignore the revents value here, + * and expect that any error/EOF is reported + * via read()/write() + */ continue; } @@ -2234,8 +2236,10 @@ ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) { return n > 0 ? n : -errno; } - if (pollfd.revents != POLLOUT) - return n > 0 ? n : -EIO; + /* We knowingly ignore the revents value here, + * and expect that any error/EOF is reported + * via read()/write() + */ continue; } |