dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
Karel Zak 18b0e4
From 338d5f2876c54e5d811100ba816d3a6dec00ab11 Mon Sep 17 00:00:00 2001
Karel Zak 18b0e4
From: Karel Zak <kzak@redhat.com>
Karel Zak 18b0e4
Date: Fri, 29 Apr 2022 10:11:49 +0200
Karel Zak 18b0e4
Subject: lsirq: improve --sort IRQ
Karel Zak 18b0e4
Karel Zak 18b0e4
IRQ column mixes numbers and text, it seems better to use strverscmp()
Karel Zak 18b0e4
rather than classic strcmp().
Karel Zak 18b0e4
Karel Zak 18b0e4
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2078787
Karel Zak 18b0e4
Upstream: http://github.com/util-linux/util-linux/commit/d382861c0815ff241fb2844a2a896f0fb1c7b73e
Karel Zak 18b0e4
Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak 18b0e4
---
Karel Zak 18b0e4
 sys-utils/irq-common.c | 2 +-
Karel Zak 18b0e4
 1 file changed, 1 insertion(+), 1 deletion(-)
Karel Zak 18b0e4
Karel Zak 18b0e4
diff --git a/sys-utils/irq-common.c b/sys-utils/irq-common.c
Karel Zak 18b0e4
index 350675394..22080b96d 100644
Karel Zak 18b0e4
--- a/sys-utils/irq-common.c
Karel Zak 18b0e4
+++ b/sys-utils/irq-common.c
Karel Zak 18b0e4
@@ -371,7 +371,7 @@ static inline int cmp_delta(const struct irq_info *a,
Karel Zak 18b0e4
 static inline int cmp_interrupts(const struct irq_info *a,
Karel Zak 18b0e4
 			   const struct irq_info *b)
Karel Zak 18b0e4
 {
Karel Zak 18b0e4
-	return (strcmp(a->irq, b->irq) > 0) ? 1 : 0;
Karel Zak 18b0e4
+	return (strverscmp(a->irq, b->irq) > 0) ? 1 : 0;
Karel Zak 18b0e4
 }
Karel Zak 18b0e4
 
Karel Zak 18b0e4
 static void sort_result(struct irq_output *out,
Karel Zak 18b0e4
-- 
Karel Zak 18b0e4
2.36.1
Karel Zak 18b0e4