summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-06 21:29:55 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-06 21:29:55 -0500
commit2b6bf07dd23bb467099d213c97b3875c5e453491 (patch)
tree2127e24f28714b48f6c00e92eaec351bcb57e5d5 /src/systemctl
parentf4336098941f94d23f2f6c79bc8d055a0907c392 (diff)
Get rid of our reimplementation of basename
The only problem is that libgen.h #defines basename to point to it's own broken implementation instead of the GNU one. This can be fixed by #undefining basename.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 6b6cb3d1d8..c6ebf9b011 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -980,7 +980,7 @@ static int compare_unit_file_list(const void *a, const void *b) {
return r;
}
- return strcasecmp(path_get_file_name(u->path), path_get_file_name(v->path));
+ return strcasecmp(basename(u->path), basename(v->path));
}
static bool output_show_unit_file(const UnitFileList *u) {
@@ -1000,7 +1000,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(path_get_file_name(u->path)));
+ max_id_len = MAX(max_id_len, strlen(basename(u->path)));
state_cols = MAX(state_cols, strlen(unit_file_state_to_string(u->state)));
}
@@ -1041,7 +1041,7 @@ static void output_unit_file_list(const UnitFileList *units, unsigned c) {
} else
on = off = "";
- id = path_get_file_name(u->path);
+ id = basename(u->path);
e = arg_full ? NULL : ellipsize(id, id_cols, 33);
@@ -2688,7 +2688,7 @@ static void print_status_info(
last = ! (*(dropin + 1) && startswith(*(dropin + 1), dir));
- printf("%s%s", path_get_file_name(*dropin), last ? "\n" : ", ");
+ printf("%s%s", basename(*dropin), last ? "\n" : ", ");
}
}
@@ -4404,7 +4404,7 @@ static int enable_sysv_units(const char *verb, char **args) {
if (!isempty(arg_root))
argv[c++] = q = strappend("--root=", arg_root);
- argv[c++] = path_get_file_name(p);
+ argv[c++] = basename(p);
argv[c++] =
streq(verb, "enable") ? "on" :
streq(verb, "disable") ? "off" : "--level=5";