From: Lasse Collin Date: Sun, 26 Jan 2020 11:27:51 +0000 (+0200) Subject: xz: Move the setting of flush_needed in file_io.c to a nicer location. X-Git-Tag: v5.3.2alpha~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3333ba4a6795a55cf0375329ba08152bd7fcbd46;p=thirdparty%2Fxz.git xz: Move the setting of flush_needed in file_io.c to a nicer location. --- diff --git a/src/xz/file_io.c b/src/xz/file_io.c index c48df6e4..83bf1511 100644 --- a/src/xz/file_io.c +++ b/src/xz/file_io.c @@ -266,11 +266,8 @@ io_wait(file_pair *pair, int timeout, bool is_reading) return IO_WAIT_ERROR; } - if (ret == 0) { - assert(opt_flush_timeout != 0); - flush_needed = true; + if (ret == 0) return IO_WAIT_TIMEOUT; - } if (pfd[0].revents != 0) return IO_WAIT_MORE; @@ -1147,6 +1144,7 @@ io_read(file_pair *pair, io_buf *buf_union, size_t size) return SIZE_MAX; case IO_WAIT_TIMEOUT: + flush_needed = true; return size - left; default: