BZFile: handle EINTR on BZ2_bzWrite (#21949)

old-commit-hash: b66e8adbefc3c8a360917fb0b8b8023374a63320
This commit is contained in:
Dean Lee
2021-08-18 18:08:07 +08:00
committed by GitHub
parent aff7f0b1f3
commit 7d09945de3
+4 -1
View File
@@ -39,7 +39,10 @@ class BZFile {
}
inline void write(void* data, size_t size) {
int bzerror;
BZ2_bzWrite(&bzerror, bz_file, data, size);
do {
BZ2_bzWrite(&bzerror, bz_file, data, size);
} while (bzerror == BZ_IO_ERROR && errno == EINTR);
if (bzerror != BZ_OK && !error_logged) {
LOGE("BZ2_bzWrite error, bzerror=%d", bzerror);
error_logged = true;