aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xz/coder.c6
-rw-r--r--src/xz/file_io.c6
-rw-r--r--src/xz/mytime.c1
3 files changed, 6 insertions, 7 deletions
diff --git a/src/xz/coder.c b/src/xz/coder.c
index 8bad038e..85f95439 100644
--- a/src/xz/coder.c
+++ b/src/xz/coder.c
@@ -733,9 +733,6 @@ coder_normal(file_pair *pair)
if (coder_write_output(pair))
break;
- // Set the time of the most recent flushing.
- mytime_set_flush_time();
-
// Mark that we haven't seen any new input
// since the previous flush.
pair->src_has_seen_input = false;
@@ -906,8 +903,7 @@ coder_run(const char *filename)
// is used.
if (opt_mode == MODE_TEST || !io_open_dest(pair)) {
// Remember the current time. It is needed
- // for progress indicator and for timed
- // flushing.
+ // for progress indicator.
mytime_set_start_time();
// Initialize the progress indicator.
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index 98918034..511aa60f 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -1167,7 +1167,11 @@ io_read(file_pair *pair, io_buf *buf, size_t size)
}
pos += (size_t)(amount);
- pair->src_has_seen_input = true;
+
+ if (!pair->src_has_seen_input) {
+ pair->src_has_seen_input = true;
+ mytime_set_flush_time();
+ }
}
return pos;
diff --git a/src/xz/mytime.c b/src/xz/mytime.c
index 573b97de..70444001 100644
--- a/src/xz/mytime.c
+++ b/src/xz/mytime.c
@@ -51,7 +51,6 @@ extern void
mytime_set_start_time(void)
{
start_time = mytime_now();
- next_flush = start_time + opt_flush_timeout;
return;
}