Commit 4eec6850 by Michel Normand Committed by Daniel Lezcano

lxc_cgroup_set not reporting error

this is a side effect of previous patch I made on this same function in commit a6ddef61Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 0bb4f8cf
...@@ -165,7 +165,7 @@ int lxc_cgroup_path_get(char **path, const char *name) ...@@ -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 lxc_cgroup_set(const char *name, const char *subsystem, const char *value)
{ {
int fd, ret = -1; int fd, ret;
char *nsgroup; char *nsgroup;
char path[MAXPATHLEN]; char path[MAXPATHLEN];
...@@ -181,7 +181,8 @@ int lxc_cgroup_set(const char *name, const char *subsystem, const char *value) ...@@ -181,7 +181,8 @@ int lxc_cgroup_set(const char *name, const char *subsystem, const char *value)
return -1; 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)); ERROR("write %s : %s", path, strerror(errno));
goto out; goto out;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment