summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-13 17:44:11 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-13 17:44:11 +0100
commit1b63cc6ea932edd1f93c3d2a78c9e34b1c7e52f0 (patch)
tree9edcf89949fc4dd120bdebf1b70b56598180ad11 /src/shared
parent25b1d72dcc833b70a27d2d2553265edb7c488246 (diff)
downloadsystemd-1b63cc6ea932edd1f93c3d2a78c9e34b1c7e52f0.tar.gz
bus-unit-procs: use empty_or_root() where appropriate
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bus-unit-procs.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c
index bf71e3b546..23c5a12454 100644
--- a/src/shared/bus-unit-procs.c
+++ b/src/shared/bus-unit-procs.c
@@ -5,6 +5,7 @@
#include "list.h"
#include "locale-util.h"
#include "macro.h"
+#include "path-util.h"
#include "process-util.h"
#include "sort-util.h"
#include "string-util.h"
@@ -23,10 +24,6 @@ struct CGroupInfo {
size_t n_children;
};
-static bool IS_ROOT(const char *p) {
- return isempty(p) || streq(p, "/");
-}
-
static int add_cgroup(Hashmap *cgroups, const char *path, bool is_const, struct CGroupInfo **ret) {
struct CGroupInfo *parent = NULL, *cg;
int r;
@@ -34,7 +31,7 @@ static int add_cgroup(Hashmap *cgroups, const char *path, bool is_const, struct
assert(cgroups);
assert(ret);
- if (IS_ROOT(path))
+ if (empty_or_root(path))
path = "/";
cg = hashmap_get(cgroups, path);
@@ -43,7 +40,7 @@ static int add_cgroup(Hashmap *cgroups, const char *path, bool is_const, struct
return 0;
}
- if (!IS_ROOT(path)) {
+ if (!empty_or_root(path)) {
const char *e, *pp;
e = strrchr(path, '/');
@@ -153,7 +150,7 @@ static int dump_processes(
assert(prefix);
- if (IS_ROOT(cgroup_path))
+ if (empty_or_root(cgroup_path))
cgroup_path = "/";
cg = hashmap_get(cgroups, cgroup_path);