Commit 19668d8b by Stéphane Graber

lxc-create: Don't print the help message twice

The forking logic was wrong, causing both the child and the parent to call the template with -h. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 09ec76ce
...@@ -107,10 +107,13 @@ static void create_helpfn(const struct lxc_arguments *args) { ...@@ -107,10 +107,13 @@ static void create_helpfn(const struct lxc_arguments *args) {
if (!args->template) if (!args->template)
return; return;
if ((pid = fork()) < 0)
return; pid = fork();
if (pid) if (pid) {
wait_for_pid(pid); wait_for_pid(pid);
return;
}
len = strlen(LXCTEMPLATEDIR) + strlen(args->template) + strlen("/lxc-") + 1; len = strlen(LXCTEMPLATEDIR) + strlen(args->template) + strlen("/lxc-") + 1;
path = alloca(len); path = alloca(len);
ret = snprintf(path, len, "%s/lxc-%s", LXCTEMPLATEDIR, args->template); ret = snprintf(path, len, "%s/lxc-%s", LXCTEMPLATEDIR, args->template);
......
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