]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_cgroup_set not reporting error
authorMichel Normand <normand@fr.ibm.com>
Fri, 8 Jan 2010 13:34:13 +0000 (14:34 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Fri, 8 Jan 2010 13:34:13 +0000 (14:34 +0100)
this is a side effect of previous patch I made
on this same function in commit
a6ddef6149858df87cf7ab3c21e2fd34d14cc452

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/cgroup.c

index 3fff51ebe03a18fe2e867c615e3cd48ec952ee45..55aa8b22f82ad7d04fda14ce01799de4ca89ff53 100644 (file)
@@ -165,7 +165,7 @@ int lxc_cgroup_path_get(char **path, const char *name)
 
 int lxc_cgroup_set(const char *name, const char *subsystem, const char *value)
 {
-       int fd, ret = -1;
+       int fd, ret;
        char *nsgroup;
        char path[MAXPATHLEN];
 
@@ -181,7 +181,8 @@ int lxc_cgroup_set(const char *name, const char *subsystem, const char *value)
                return -1;
        }
 
-       if (write(fd, value, strlen(value)) < 0) {
+       ret = write(fd, value, strlen(value));
+       if (ret < 0) {
                ERROR("write %s : %s", path, strerror(errno));
                goto out;
        }