diff options
author | David Teigland <teigland@redhat.com> | 2017-02-15 14:09:45 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2017-02-15 14:10:46 -0600 |
commit | 2556498ee191cc9eaa505c611c5570937ff32315 (patch) | |
tree | 3a1e9b73a936051143fb1493b28dd31dc6369a47 | |
parent | 4a30f5f9b0a3677af6f32260ee84ec5c2a6c8393 (diff) | |
download | lvm2-2556498ee191cc9eaa505c611c5570937ff32315.tar.gz |
lvcreate: fix LVM_VG_NAME detection
Commit d3af0e7528dbba30824379fc98cb4db437559ad5 was
not quite right in testing if the env var was set.
-rw-r--r-- | tools/lvmcmdline.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 41ae8c4b8..ed32f1cf5 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -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))) { |