diff options
author | Richard Fitzgerald <rf@opensource.wolfsonmicro.com> | 2013-08-29 09:32:02 +0100 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-09-26 18:15:40 -0700 |
commit | a85e245a09c028d36cbf04f233be10bc583691f5 (patch) | |
tree | 6f64996e4d7484896e61651c8965ec5f52382644 | |
parent | adad134c906042742a801fb66eb4271a7130af83 (diff) | |
download | tinycompress-kitkat-release.tar.gz |
Update to latest tinycompressandroid-sdk-4.4.2_r1.0.1android-sdk-4.4.2_r1android-cts-4.4_r4android-cts-4.4_r1android-4.4_r1.2.0.1android-4.4_r1.2android-4.4_r1.1.0.1android-4.4_r1.1android-4.4_r1.0.1android-4.4_r1android-4.4_r0.9android-4.4.2_r2.0.1android-4.4.2_r2android-4.4.2_r1.0.1android-4.4.2_r1android-4.4.1_r1.0.1android-4.4.1_r1kitkat-releasekitkat-mr1.1-releasekitkat-mr1-releasekitkat-cts-releasekitkat-cts-dev
2b0410a compress: Must check for POLLERR before POLLOUT/POLLIN
Bug: 8174034.
Change-Id: I26a7bd4bf3999afbe99a2278a59304834980375e
-rw-r--r-- | compress.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -378,6 +378,9 @@ int compress_write(struct compress *compress, const void *buf, unsigned int size 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)) @@ -387,9 +390,6 @@ int compress_write(struct compress *compress, const void *buf, unsigned int size if (fds.revents & POLLOUT) { continue; } - if (fds.revents & POLLERR) { - return oops(compress, EIO, "poll returned error!"); - } } /* write avail bytes */ if (size > avail.avail) @@ -438,6 +438,9 @@ int compress_read(struct compress *compress, void *buf, unsigned int size) 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)) @@ -447,9 +450,6 @@ int compress_read(struct compress *compress, void *buf, unsigned int size) if (fds.revents & POLLIN) { continue; } - if (fds.revents & POLLERR) { - return oops(compress, EIO, "poll returned error!"); - } } /* read avail bytes */ if (size > avail.avail) @@ -616,15 +616,15 @@ int compress_wait(struct compress *compress, int timeout_ms) 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; } |