dcavalca / rpms / util-linux

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