]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
[cgfsng] show wrong errno 2109/head
authorduguhaotian <duguhaotian@gmail.com>
Fri, 26 Jan 2018 13:07:58 +0000 (21:07 +0800)
committerduguhaotian <duguhaotian@gmail.com>
Fri, 26 Jan 2018 13:07:58 +0000 (21:07 +0800)
lxc_cgroup_set_data: h = get_hierarchy(controller);
if h is NULL, now errno is old, it donot set new one.
And then,
cgfsng_setup_limits:

    if (lxc_cgroup_set_data(cg->subsystem, cg->value, d)) {
if (do_devices && (errno == EACCES ||
errno == EPERM)) {
WARN("Error setting %s to %s for %s",
cg->subsystem, cg->value,
d->name);
continue;
}
SYSERROR("Error setting %s to %s for
 %s",
 cg->subsystem, cg->value,
 d->name);
goto out;
}

SYSERROR will show old errno, make me confused.

Signed-off-by: duguhaotian <duguhaotian@gmail.com>
src/lxc/cgroups/cgfsng.c

index 2d1ad4ebb82fd757a694be38724c9002102a0eae..027d369e8bdfa4e0840ecb792f415fc7241e37f4 100644 (file)
@@ -2143,6 +2143,7 @@ static int lxc_cgroup_set_data(const char *filename, const char *value, struct c
                      "The controller seems to be unused by \"cgfsng\" cgroup "
                      "driver or not enabled on the cgroup hierarchy",
                      controller);
+               errno = ENOENT;
                return -1;
        }