]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsirq: use strcoll() to sort
authorKarel Zak <kzak@redhat.com>
Thu, 1 Sep 2022 09:05:20 +0000 (11:05 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 1 Sep 2022 09:05:20 +0000 (11:05 +0200)
It's more user-friendly to follow locale.

Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/irq-common.c

index c6c1be095c9c8c26c8c1401db6a8284676f04b2d..892425057008bb0bf30633542e58937897651ed5 100644 (file)
@@ -366,7 +366,7 @@ void free_irqstat(struct irq_stat *stat)
 static inline int cmp_name(const struct irq_info *a,
                     const struct irq_info *b)
 {
-       return (strcmp(a->name, b->name) > 0) ? 1 : 0;
+       return strcoll(a->name, b->name);
 }
 
 static inline int cmp_total(const struct irq_info *a,
@@ -384,7 +384,7 @@ static inline int cmp_delta(const struct irq_info *a,
 static inline int cmp_interrupts(const struct irq_info *a,
                           const struct irq_info *b)
 {
-       return (strverscmp(a->irq, b->irq) > 0) ? 1 : 0;
+       return strverscmp(a->irq, b->irq);
 }
 
 static void sort_result(struct irq_output *out,