cdown / rpms / util-linux

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