return total;
ret = poll(&fds, 1, compress->max_poll_wait_ms);
+ if (fds.revents & POLLERR) {
+ return oops(compress, EIO, "poll returned error!");
+ }
/* A pause will cause -EBADFD or zero.
* This is not an error, just stop writing */
if ((ret == 0) || (ret == -EBADFD))
if (fds.revents & POLLOUT) {
continue;
}
- if (fds.revents & POLLERR) {
- return oops(compress, EIO, "poll returned error!");
- }
}
/* write avail bytes */
if (size > avail.avail)
return total;
ret = poll(&fds, 1, compress->max_poll_wait_ms);
+ if (fds.revents & POLLERR) {
+ return oops(compress, EIO, "poll returned error!");
+ }
/* A pause will cause -EBADFD or zero.
* This is not an error, just stop reading */
if ((ret == 0) || (ret == -EBADFD))
if (fds.revents & POLLIN) {
continue;
}
- if (fds.revents & POLLERR) {
- return oops(compress, EIO, "poll returned error!");
- }
}
/* read avail bytes */
if (size > avail.avail)
fds.events = POLLOUT | POLLIN;
ret = poll(&fds, 1, timeout_ms);
+ if (fds.revents & POLLERR) {
+ return oops(compress, EIO, "poll returned error!");
+ }
/* A pause will cause -EBADFD or zero. */
if ((ret < 0) && (ret != -EBADFD))
return oops(compress, errno, "poll error");
if (fds.revents & (POLLOUT | POLLIN)) {
return 0;
}
- if (fds.revents & POLLERR) {
- return oops(compress, EIO, "poll returned error!");
- }
return ret;
}