summaryrefslogtreecommitdiffstats
path: root/src/busctl
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-18 01:39:24 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-19 01:02:52 +0200
commit93bab288956f43c70f2b28a88efdc9effd951bb5 (patch)
tree453abf294f7bf2aba7ccf7ed37ccd669ec231c95 /src/busctl
parentdetect-virt: do not try to read all of /proc/cpuinfo (diff)
downloadsystemd-93bab288956f43c70f2b28a88efdc9effd951bb5.tar.xz
systemd-93bab288956f43c70f2b28a88efdc9effd951bb5.zip
tree-wide: use typesafe_qsort()
Diffstat (limited to 'src/busctl')
-rw-r--r--src/busctl/busctl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c
index 9dc522ad18..1fe6500ae8 100644
--- a/src/busctl/busctl.c
+++ b/src/busctl/busctl.c
@@ -739,10 +739,8 @@ static int member_compare_func(const void *a, const void *b) {
return strcmp_ptr(x->name, y->name);
}
-static int member_compare_funcp(const void *a, const void *b) {
- const Member *const * x = (const Member *const *) a, * const *y = (const Member *const *) b;
-
- return member_compare_func(*x, *y);
+static int member_compare_funcp(Member * const *a, Member * const *b) {
+ return member_compare_func(*a, *b);
}
static void member_free(Member *m) {
@@ -1063,7 +1061,7 @@ static int introspect(int argc, char **argv, void *userdata) {
if (result_width > 40)
result_width = 40;
- qsort(sorted, k, sizeof(Member*), member_compare_funcp);
+ typesafe_qsort(sorted, k, member_compare_funcp);
if (arg_legend) {
printf("%-*s %-*s %-*s %-*s %s\n",