]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: fix --since and --until
authorKarel Zak <kzak@redhat.com>
Wed, 20 Apr 2022 12:42:32 +0000 (14:42 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Apr 2022 12:42:32 +0000 (14:42 +0200)
Now --since and --until requires any time field in the output (e.g.
--ctime,-T), it means "dmesg --since '1 day ago'" doesn't work, but
"dmesg -T --since '1 day ago'" works as expected.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2076829
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index 7cca88f2bb465a07c4d4db998415c73de99bce1a..017936255fda6a26675fd8542a234e7417f0da60 100644 (file)
@@ -1592,7 +1592,9 @@ int main(int argc, char *argv[])
 
        if ((is_timefmt(&ctl, RELTIME) ||
             is_timefmt(&ctl, CTIME)   ||
-            is_timefmt(&ctl, ISO8601))) {
+            is_timefmt(&ctl, ISO8601)) ||
+            ctl.since ||
+            ctl.until) {
                if (dmesg_get_boot_time(&ctl.boot_time) != 0)
                        ctl.time_fmt = DMESG_TIMEFTM_NONE;
                else