Re: [systemd-devel] [PATCH] util.c: ignore pollfd.revent for loop_read/loop_write
2013/9/26 Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl: On Sun, Sep 22, 2013 at 09:10:47PM +0800, cee1 wrote: Let read()/write() report any error/EOF. This look OK, but can you provide a bit of motivation? It's a re-sent patch, the original thread is at http://lists.freedesktop.org/archives/systemd-devel/2013-September/013092.html -- Regards, - cee1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] util.c: ignore pollfd.revent for loop_read/loop_write
On Sun, Sep 22, 2013 at 09:10:47PM +0800, cee1 wrote: Let read()/write() report any error/EOF. This look OK, but can you provide a bit of motivation? Zbyszek --- src/shared/util.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/shared/util.c b/src/shared/util.c index 2009553..3c08650 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; } -- ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] util.c: ignore pollfd.revent for loop_read/loop_write
Let read()/write() report any error/EOF. --- src/shared/util.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/shared/util.c b/src/shared/util.c index 2009553..3c08650 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; } -- 1.8.3.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel