]> git.ipfire.org Git - thirdparty/util-linux.git/commit
dmesg: make time stamps to be printed consistently
authorSami Kerola <kerolasa@iki.fi>
Sun, 30 Jun 2013 18:11:22 +0000 (19:11 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 1 Jul 2013 12:30:20 +0000 (14:30 +0200)
commit3c5384d05d3283cf93b5dbd8a4bb4fe245c4c19d
tree595d168a7c280c2dc30e312240084145de605a65
parent3b347e26387e3fc6fc5a75f04d02a3685ce0ecac
dmesg: make time stamps to be printed consistently

Earlier uptime determination, which was done with sysinfo(2), had one
second resolution, which made time stamps to be rounded unstable way
depending on when a dmesg command was executed.  In practical terms; the
command below was supposed not to differ but it did.

$ diff -q <(dmesg --ctime) <(sleep 0.5 ; dmesg --ctime)

[kzak@redhat.com: - add -lrt to Makemodule.am,
                  - fallback to sysinfo() based boot time
                  - use #ifdef]

CC: Kay Sievers <kay@vrfy.org>
References: https://lkml.org/lkml/2013/6/30/37
Buglink: https://github.com/karelzak/util-linux/issues/24
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/Makemodule.am
sys-utils/dmesg.c