1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

cgroup-util: laccess() returns negative errno already

This commit is contained in:
Lennart Poettering 2021-11-14 22:30:57 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 12a9f68f06
commit cb3763d57b

View File

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