master - commands: initialize commands[] once
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1cb95fa5a050c5056d882ef9cbb01ce8040df019 Commit: 1cb95fa5a050c5056d882ef9cbb01ce8040df019 Parent: 15f51bc42113494bfb49fbc0d6a1913f68fb80a8 Author: David Teigland <[email protected]> AuthorDate: Thu Feb 16 13:59:52 2017 -0600 Committer: David Teigland <[email protected]> CommitterDate: Thu Feb 16 13:59:52 2017 -0600
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.
--- tools/lvmcmdline.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
tools/lvmcmdline.c +4 -0
@@ -1130,6 +1130,10 @@ void lvm_register_commands(char *name) {int i; +/* already initialized */ +if (_cmdline.commands) +return ; +memset (&commands,0 ,sizeof (commands));/*