From: Chen Jie Date: Thu, 12 Sep 2013 01:21:41 +0000 (+0800) Subject: util.c: ignore pollfd.revent for loop_read/loop_write X-Git-Tag: v208~13 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c22ceead439fbd7825acb14b5db904851d0389ef;p=elogind.git util.c: ignore pollfd.revent for loop_read/loop_write Let read()/write() report any error/EOF. --- diff --git a/src/shared/util.c b/src/shared/util.c index fb42d663a..5dc605eb8 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; }