diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-10-19 04:52:25 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-10-19 04:53:45 +0200 |
commit | 857a493d55f94731394e4d9f61ffce661858e9a0 (patch) | |
tree | c22dbe69057894a6a76f8ba8d074a560af40a5bb /src/timedate/timedatectl.c | |
parent | 9590dfe771d1f499703414c5c5cf21eec7ef69a4 (diff) |
set: introduce strv_sort()
Diffstat (limited to 'src/timedate/timedatectl.c')
-rw-r--r-- | src/timedate/timedatectl.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 2b006ce924..469a65e635 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -349,12 +349,6 @@ static int set_ntp(DBusConnection *bus, char **args, unsigned n) { DBUS_TYPE_INVALID); } -static int zone_compare(const void *_a, const void *_b) { - const char **a = (const char**) _a, **b = (const char**) _b; - - return strcmp(*a, *b); -} - static int list_timezones(DBusConnection *bus, char **args, unsigned n) { _cleanup_fclose_ FILE *f = NULL; _cleanup_strv_free_ char **zones = NULL; @@ -416,12 +410,11 @@ static int list_timezones(DBusConnection *bus, char **args, unsigned n) { } if (zones) - zones[n_zones] = 0; - - qsort(zones, n_zones, sizeof(char*), zone_compare); + zones[n_zones] = NULL; pager_open_if_enabled(); + strv_sort(zones); STRV_FOREACH(i, zones) puts(*i); |