1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Don't run any complex initialisation for the "version" lvm2 command.

We can use it even in read-only environment where a try to initialise
file-based locking fails (not to mention other processing related with
lvm2 init). Simply, we want to output the version only, nothing else.
And this should always work.
This commit is contained in:
Peter Rajnoha 2010-04-30 13:28:44 +00:00
parent 244646902c
commit 5ff4274f9b

View File

@ -1364,6 +1364,10 @@ int lvm2_main(int argc, char **argv)
unsetenv("LVM_DID_EXEC");
}
/* "version" command is simple enough so it doesn't need any complex init */
if (!alias && argc > 1 && !strcmp(argv[1], "version"))
return version(NULL, argc, argv);
if (!(cmd = init_lvm()))
return -1;