]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup-util: laccess() returns negative errno already
authorLennart Poettering <lennart@poettering.net>
Sun, 14 Nov 2021 21:30:57 +0000 (22:30 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Nov 2021 07:04:09 +0000 (08:04 +0100)
src/basic/cgroup-util.c

index e5f38c65d04883276def09f10347efbd09d8a3f8..87f491808b7df478da9959bc7ff67e257ffd79d8 100644 (file)
@@ -587,10 +587,7 @@ static int controller_is_v1_accessible(const char *root, const char *controller)
          * - we can modify the hierarchy. */
 
         cpath = strjoina("/sys/fs/cgroup/", dn, root, root ? "/cgroup.procs" : NULL);
-        if (laccess(cpath, root ? W_OK : F_OK) < 0)
-                return -errno;
-
-        return 0;
+        return laccess(cpath, root ? W_OK : F_OK);
 }
 
 int cg_get_path_and_check(const char *controller, const char *path, const char *suffix, char **fs) {