mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-01 02:35:05 +00:00
util.c: ignore pollfd.revent for loop_read/loop_write
Let read()/write() report any error/EOF.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
8e3aceb513
commit
de55428968
+8
-4
@@ -2193,8 +2193,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;
|
||||
}
|
||||
@@ -2241,8 +2243,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user