summaryrefslogtreecommitdiff
path: root/chronic
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-10-17 11:49:07 -0400
committerJoey Hess <joeyh@joeyh.name>2016-10-17 11:49:07 -0400
commit53c35a635276bb78f098947755dd072b5b800358 (patch)
tree8dd1d4a33df25d24d624aa6d238e2052231311f4 /chronic
parent1173bd9f10d731485f3b63f1c7ff55eb9c58a605 (diff)
downloadmoreutils-53c35a635276bb78f098947755dd072b5b800358.tar.gz
chronic: Flush output more often to better preserve stdout,err ordering.
Particularly when a chunk that is not newline-terminated is read, this makes it be flushed right away. Thanks, Miroslav Ĺ ustek
Diffstat (limited to 'chronic')
-rwxr-xr-xchronic2
1 files changed, 2 insertions, 0 deletions
diff --git a/chronic b/chronic
index 7cfc2d6..cb927b3 100755
--- a/chronic
+++ b/chronic
@@ -86,7 +86,9 @@ else {
sub showout {
print "STDOUT:\n" if $opt_v;
print STDOUT $out;
+ STDOUT->flush();
print "\nSTDERR:\n" if $opt_v;
print STDERR $err;
+ STDERR->flush();
print "\nRETVAL: ".($ret >> 8)."\n" if $opt_v;
}