mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-16 07:02:02 +00:00
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 <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
09ec76ceec
commit
19668d8b07
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user