]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: flush stdout in hwclock -c
authorAlexey Galakhov <agalakhov@gmail.com>
Thu, 16 Apr 2015 15:26:27 +0000 (17:26 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 29 Apr 2015 10:44:49 +0000 (12:44 +0200)
This allows using hwclock -c in automated test scripts that parse
its output line-by-line. The standard output is flushed before
each 10 second delay.

Signed-off-by: Alexey Galakhov <agalakhov@gmail.com>
sys-utils/hwclock.c

index 1cc3bd2dd30abf19d8f69b443a1e65a21cfb4557..c9d422d35cb84605a129b14a8780b7b6449fb0bb 100644 (file)
@@ -1525,6 +1525,7 @@ static int compare_clock (const bool utc, const bool local_opt)
                        printf("hw-time      system-time         freq-offset-ppm   tick\n");
                        printf("%10.0f   %10.6f\n", (double) time1_hw, time1_sys);
                }
+               fflush(stdout);
                sleep(10);
        }