summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-util.c
diff options
context:
space:
mode:
authorSimon Peeters <peeters.simon@gmail.com>2014-01-04 02:35:23 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-05 00:59:13 -0500
commitb68fa010f72599e6da5822feda5ae3a47a4e63d8 (patch)
tree046694049da4187b5a8bbe85d4bca92960f2fa3e /src/shared/cgroup-util.c
parent9dddaedfcc70c6dc37ba6a48d1d8e27e12c0cb2e (diff)
shared: procfs_file_alloca: handle pid==0
when pid is set to 0 use /proc/self
Diffstat (limited to 'src/shared/cgroup-util.c')
-rw-r--r--src/shared/cgroup-util.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index f2af8dcfda..855c9cd160 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -746,10 +746,7 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
} else
controller = SYSTEMD_CGROUP_CONTROLLER;
- if (pid == 0)
- fs = "/proc/self/cgroup";
- else
- fs = procfs_file_alloca(pid, "cgroup");
+ fs = procfs_file_alloca(pid, "cgroup");
f = fopen(fs, "re");
if (!f)