lxc-attach: switch to attach_run_wait

parent 999ef15f
...@@ -354,9 +354,12 @@ int main(int argc, char *argv[]) ...@@ -354,9 +354,12 @@ int main(int argc, char *argv[])
goto out; goto out;
} }
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;
...@@ -367,6 +370,7 @@ int main(int argc, char *argv[]) ...@@ -367,6 +370,7 @@ int main(int argc, char *argv[])
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