]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
[cgfsng] show wrong errno
authorduguhaotian <duguhaotian@gmail.com>
Fri, 26 Jan 2018 13:07:58 +0000 (21:07 +0800)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 6 Feb 2018 12:34:31 +0000 (13:34 +0100)
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 16447c342fd9df4b9c00ed39ad75ab4725ff2c2c..00730116389c44001677e1c3bf2b499e723cd069 100644 (file)
@@ -2119,6 +2119,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;
        }