mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
commands: initialize commands[] once
When using liblvm2cmd, a process can do multiple init/exit calls, i.e. lvm2_init(); lvm2_run(); lvm2_exit(); lvm2_init(); lvm2_run(); lvm2_exit(); ... define_commands() needs to set up the global commands[] definitions only the first time.
This commit is contained in:
parent
15f51bc421
commit
1cb95fa5a0
@ -1130,6 +1130,10 @@ void lvm_register_commands(char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* already initialized */
|
||||
if (_cmdline.commands)
|
||||
return;
|
||||
|
||||
memset(&commands, 0, sizeof(commands));
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user