BZFile: handle EINTR on BZ2_bzWrite (#21949)

pull/21957/head
Dean Lee 4 years ago committed by GitHub
parent 4625098a79
commit b66e8adbef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      selfdrive/loggerd/logger.h

@ -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;

Loading…
Cancel
Save