]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: tweak return values
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Feb 2021 23:49:25 +0000 (00:49 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Feb 2021 23:49:25 +0000 (00:49 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index d41a8ed88b978320242164283f348fbd4c8b3098..e451658a3cb40c085252519292deec0d2edebf3c 100644 (file)
@@ -3327,11 +3327,11 @@ static int cg_hybrid_init(struct cgroup_ops *ops, bool relative, bool unprivileg
        else
                basecginfo = read_file_at(-EBADF, "/proc/self/cgroup", PROTECT_OPEN, 0);
        if (!basecginfo)
-               return ret_set_errno(-1, ENOMEM);
+               return ret_errno(ENOMEM);
 
        ret = get_existing_subsystems(&klist, &nlist);
        if (ret < 0)
-               return log_error_errno(-1, errno, "Failed to retrieve available legacy cgroup controllers");
+               return syserrno(-errno, "Failed to retrieve available legacy cgroup controllers");
 
        f = fopen("/proc/self/mountinfo", "re");
        if (!f)
@@ -3496,7 +3496,7 @@ static int __cgroup_init(struct cgroup_ops *ops, struct lxc_conf *conf)
        const char *controllers_use;
 
        if (ops->dfd_mnt_cgroupfs_host >= 0)
-               return ret_errno(EINVAL);
+               return ret_errno(EBUSY);
 
        /*
         * I don't see the need for allowing symlinks here. If users want to