Commit 3139aead by Stéphane Graber

Fix return value of userns_exec_1

Instead of always returning -1 and call SYSERROR when the child returns non-zero. Have userns_exec_1 always return the return value from the function it's calling and let the caller do the error handling (as is already done by its only caller). Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 275a2d0b
...@@ -4054,10 +4054,11 @@ int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data) ...@@ -4054,10 +4054,11 @@ int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data)
goto err; goto err;
} }
if ((ret = wait_for_pid(pid)) < 0) { ret = wait_for_pid(pid);
ERROR("Child returned an error: %d\n", ret);
goto err; close(p[1]);
} return ret;
err: err:
if (p[0] != -1) if (p[0] != -1)
close(p[0]); close(p[0]);
......
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