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: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
goto err;
}
- if ((ret = wait_for_pid(pid)) < 0) {
- ERROR("Child returned an error: %d\n", ret);
- goto err;
- }
+ ret = wait_for_pid(pid);
+
+ close(p[1]);
+ return ret;
+
err:
if (p[0] != -1)
close(p[0]);