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

lvcreate: fix LVM_VG_NAME detection

Commit d3af0e7528dbba30824379fc98cb4db437559ad5 was
not quite right in testing if the env var was set.
This commit is contained in:
David Teigland 2017-02-15 14:09:45 -06:00
parent 4a30f5f9b0
commit 2556498ee1

View File

@ -1280,7 +1280,6 @@ check_val:
static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp, char **argv)
{
const char *name;
char *gotenv = NULL;
/*
* rp is the index in required_pos_args[] of the required positional arg.
@ -1315,9 +1314,9 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
(arg_is_set(cmd, name_ARG) ||
arg_is_set(cmd, thinpool_ARG) ||
arg_is_set(cmd, cachepool_ARG) ||
(gotenv = getenv("LVM_VG_NAME")))) {
getenv("LVM_VG_NAME"))) {
if (gotenv)
if (getenv("LVM_VG_NAME"))
return 1;
if ((name = arg_str_value(cmd, name_ARG, NULL))) {