From: Stéphane Graber Date: Thu, 16 Jan 2014 03:53:20 +0000 (-0500) Subject: lxc-create: Don't print the help message twice X-Git-Tag: lxc-1.0.0.beta3~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19668d8b0798d4078f17f83241b6c113a0ed1bb0;p=thirdparty%2Flxc.git 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: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/lxc_create.c b/src/lxc/lxc_create.c index 6d94709d1..058dc43bd 100644 --- a/src/lxc/lxc_create.c +++ b/src/lxc/lxc_create.c @@ -107,10 +107,13 @@ static void create_helpfn(const struct lxc_arguments *args) { if (!args->template) return; - if ((pid = fork()) < 0) - return; - if (pid) + + pid = fork(); + if (pid) { wait_for_pid(pid); + return; + } + len = strlen(LXCTEMPLATEDIR) + strlen(args->template) + strlen("/lxc-") + 1; path = alloca(len); ret = snprintf(path, len, "%s/lxc-%s", LXCTEMPLATEDIR, args->template);