From: Michel Normand Date: Fri, 8 Jan 2010 13:34:13 +0000 (+0100) Subject: lxc_cgroup_set not reporting error X-Git-Tag: lxc-0.6.5~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eec6850fcc88e020c48580851a4c328a6860be1;p=thirdparty%2Flxc.git lxc_cgroup_set not reporting error this is a side effect of previous patch I made on this same function in commit a6ddef6149858df87cf7ab3c21e2fd34d14cc452 Signed-off-by: Michel Normand Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c index 3fff51ebe..55aa8b22f 100644 --- a/src/lxc/cgroup.c +++ b/src/lxc/cgroup.c @@ -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; }