chiark / gitweb /
Classify processes from sessions into cgroups
[elogind.git] / src / shared / cgroup-util.c
index c746d606d9ff648c29cbcd530d579b5e87acd547..99d06540a1579df953bd4a88c5d84a242e718beb 100644 (file)
@@ -33,7 +33,6 @@
 #include "set.h"
 #include "macro.h"
 #include "util.h"
-#include "formats-util.h"
 #include "path-util.h"
 #include "fileio.h"
 #include "special.h"
@@ -487,10 +486,8 @@ 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;
-                if (r == 0)
-                        return -ENOENT;
+                if (r <= 0)
+                        return r < 0 ? r : -ENOENT;
 
                 /* Cache this to save a few stat()s */
                 good = true;