summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-05-07 21:36:12 +0200
committerKay Sievers <kay@vrfy.org>2012-05-08 02:33:10 +0200
commit9eb977db5b89b44f254ab40c1876a76b7d7ea2d0 (patch)
treed73a79d15c67aea358006832a1187ce66486b940 /src/systemctl
parentbbc98d32560cc456531bf254f7b69054921082bd (diff)
util: split-out path-util.[ch]
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index c08d80912a..acede4e765 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -45,6 +45,7 @@
#include "utmp-wtmp.h"
#include "special.h"
#include "initreq.h"
+#include "path-util.h"
#include "strv.h"
#include "dbus-common.h"
#include "cgroup-show.h"
@@ -61,6 +62,7 @@
#include "spawn-polkit-agent.h"
#include "install.h"
#include "logs-show.h"
+#include "path-util.h"
static const char *arg_type = NULL;
static char **arg_property = NULL;
@@ -560,7 +562,7 @@ static int compare_unit_file_list(const void *a, const void *b) {
return r;
}
- return strcasecmp(file_name_from_path(u->path), file_name_from_path(v->path));
+ return strcasecmp(path_get_file_name(u->path), path_get_file_name(v->path));
}
static bool output_show_unit_file(const UnitFileList *u) {
@@ -579,7 +581,7 @@ static void output_unit_file_list(const UnitFileList *units, unsigned c) {
if (!output_show_unit_file(u))
continue;
- max_id_len = MAX(max_id_len, strlen(file_name_from_path(u->path)));
+ max_id_len = MAX(max_id_len, strlen(path_get_file_name(u->path)));
state_cols = MAX(state_cols, strlen(unit_file_state_to_string(u->state)));
}
@@ -616,7 +618,7 @@ static void output_unit_file_list(const UnitFileList *units, unsigned c) {
} else
on = off = "";
- id = file_name_from_path(u->path);
+ id = path_get_file_name(u->path);
e = arg_full ? NULL : ellipsize(id, id_cols, 33);
@@ -3721,7 +3723,7 @@ static int enable_sysv_units(char **args) {
if (!isempty(arg_root))
argv[c++] = q = strappend("--root=", arg_root);
- argv[c++] = file_name_from_path(p);
+ argv[c++] = path_get_file_name(p);
argv[c++] =
streq(verb, "enable") ? "on" :
streq(verb, "disable") ? "off" : "--level=5";