lxc-attach: switch to attach_run_wait

parent 999ef15f
......@@ -354,19 +354,23 @@ int main(int argc, char *argv[])
goto out;
}
if (command.program)
ret = c->attach(c, lxc_attach_run_command, &command, &attach_options, &pid);
else
if (command.program) {
ret = c->attach_run_wait(c, &attach_options, command.program,
(const char **)command.argv);
if (ret < 0)
goto out;
} else {
ret = c->attach(c, lxc_attach_run_shell, NULL, &attach_options, &pid);
if (ret < 0)
goto out;
if (ret < 0)
goto out;
ret = lxc_wait_for_pid_status(pid);
if (ret < 0)
goto out;
ret = lxc_wait_for_pid_status(pid);
if (ret < 0)
goto out;
if (WIFEXITED(ret))
wexit = WEXITSTATUS(ret);
if (WIFEXITED(ret))
wexit = WEXITSTATUS(ret);
}
out:
lxc_container_put(c);
......
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