X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fcgroup-util.c;h=c746d606d9ff648c29cbcd530d579b5e87acd547;hb=01c94c5d0aff09b4c0e429d483c8eeba40017071;hp=99d06540a1579df953bd4a88c5d84a242e718beb;hpb=162255186046fa7a5e82859b7dba5a7909ce6fc4;p=elogind.git diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index 99d06540a..c746d606d 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -33,6 +33,7 @@ #include "set.h" #include "macro.h" #include "util.h" +#include "formats-util.h" #include "path-util.h" #include "fileio.h" #include "special.h" @@ -486,8 +487,10 @@ int cg_get_path(const char *controller, const char *path, const char *suffix, ch int r; r = path_is_mount_point("/sys/fs/cgroup", false); - if (r <= 0) - return r < 0 ? r : -ENOENT; + if (r < 0) + return r; + if (r == 0) + return -ENOENT; /* Cache this to save a few stat()s */ good = true;