cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0018-dmesg-fix-since-and-until.patch

d8d8bc
From f45fe0768ac09cb5e05b095afa47a0a71e931f84 Mon Sep 17 00:00:00 2001
d8d8bc
From: Karel Zak <kzak@redhat.com>
d8d8bc
Date: Wed, 20 Apr 2022 14:42:32 +0200
d8d8bc
Subject: dmesg: fix --since and --until
d8d8bc
d8d8bc
Now --since and --until requires any time field in the output (e.g.
d8d8bc
--ctime,-T), it means "dmesg --since '1 day ago'" doesn't work, but
d8d8bc
"dmesg -T --since '1 day ago'" works as expected.
d8d8bc
d8d8bc
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2076829
d8d8bc
Upstream: http://github.com/util-linux/util-linux/commit/c9667633f1f6b7a84116f2af067d1d15c72e6382
d8d8bc
Signed-off-by: Karel Zak <kzak@redhat.com>
d8d8bc
---
d8d8bc
 sys-utils/dmesg.c | 4 +++-
d8d8bc
 1 file changed, 3 insertions(+), 1 deletion(-)
d8d8bc
d8d8bc
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
d8d8bc
index d301951bb..5c580107a 100644
d8d8bc
--- a/sys-utils/dmesg.c
d8d8bc
+++ b/sys-utils/dmesg.c
d8d8bc
@@ -1539,7 +1539,9 @@ int main(int argc, char *argv[])
d8d8bc
 
d8d8bc
 	if ((is_timefmt(&ctl, RELTIME) ||
d8d8bc
 	     is_timefmt(&ctl, CTIME)   ||
d8d8bc
-	     is_timefmt(&ctl, ISO8601))) {
d8d8bc
+	     is_timefmt(&ctl, ISO8601)) ||
d8d8bc
+	     ctl.since ||
d8d8bc
+	     ctl.until) {
d8d8bc
 		if (dmesg_get_boot_time(&ctl.boot_time) != 0)
d8d8bc
 			ctl.time_fmt = DMESG_TIMEFTM_NONE;
d8d8bc
 		else
d8d8bc
-- 
d8d8bc
2.36.1
d8d8bc