lxc-attach: switch to attach_run_wait

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