]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xz: Move the setting of flush_needed in file_io.c to a nicer location.
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 26 Jan 2020 11:27:51 +0000 (13:27 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 26 Jan 2020 11:27:51 +0000 (13:27 +0200)
src/xz/file_io.c

index c48df6e43c3562ef6e1fadbcc3224525fca1d7a2..83bf1511b432212faa7f23ab660b816d900222a5 100644 (file)
@@ -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: