summaryrefslogtreecommitdiff
path: root/src/shared/install.c
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/shared/install.c
parentbbc98d32560cc456531bf254f7b69054921082bd (diff)
util: split-out path-util.[ch]
Diffstat (limited to 'src/shared/install.c')
-rw-r--r--src/shared/install.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/shared/install.c b/src/shared/install.c
index a77dfc77e4..fc1bf96207 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -29,6 +29,7 @@
#include "mkdir.h"
#include "hashmap.h"
#include "set.h"
+#include "path-util.h"
#include "path-lookup.h"
#include "strv.h"
#include "unit-name.h"
@@ -283,7 +284,7 @@ static int remove_marked_symlinks_fd(
found =
set_get(remove_symlinks_to, dest) ||
- set_get(remove_symlinks_to, file_name_from_path(dest));
+ set_get(remove_symlinks_to, path_get_file_name(dest));
if (found) {
@@ -468,7 +469,7 @@ static int find_symlinks_fd(
if (path_is_absolute(name))
found_dest = path_equal(dest, name);
else
- found_dest = streq(file_name_from_path(dest), name);
+ found_dest = streq(path_get_file_name(dest), name);
free(dest);
@@ -754,7 +755,7 @@ int unit_file_link(
char *path, *fn;
struct stat st;
- fn = file_name_from_path(*i);
+ fn = path_get_file_name(*i);
if (!path_is_absolute(*i) ||
!unit_name_is_valid_no_type(fn, true)) {
@@ -917,7 +918,7 @@ static int install_info_add(
assert(name || path);
if (!name)
- name = file_name_from_path(path);
+ name = path_get_file_name(path);
if (!unit_name_is_valid_no_type(name, true))
return -EINVAL;
@@ -1915,7 +1916,7 @@ int unit_file_get_list(
continue;
found:
- r = hashmap_put(h, file_name_from_path(f->path), f);
+ r = hashmap_put(h, path_get_file_name(f->path), f);
if (r < 0) {
free(f->path);
free(f);