1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

clvmd: fix parsing of -d argument

clvmd -d option parsing was not working properly.

clvmd -d 2   (with space) has been ignored because of
'::' used in getopt string, and as failsafe it's been used '1'.

Later this debug_arg has been ignored and debug_opt was used
instead which happend to have value '1'.

Submitted-by: Robert Milasan <rmilasan at suse.com>
Reported-by: Robert Milasan  <rmilasan at suse.com>
This commit is contained in:
Zdenek Kabelac 2012-10-19 15:18:19 +02:00
parent 5f5a5d1f53
commit 13fe333b54
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Fix clvmd support for option -d and properly use its argument.
Support use of option --yes for lvchange --persistent.
Fix memory leak on error path for pvcreate with invalid uuid.
Use lv_is_active() instead of lv_info() call.

View File

@ -362,7 +362,7 @@ int main(int argc, char *argv[])
/* Deal with command-line arguments */
opterr = 0;
optind = 0;
while ((opt = getopt_long(argc, argv, "vVhfd::t:RST:CI:E:",
while ((opt = getopt_long(argc, argv, "vVhfd:t:RST:CI:E:",
longopts, NULL)) != -1) {
switch (opt) {
case 'h':
@ -449,7 +449,7 @@ int main(int argc, char *argv[])
return debug_clvmd(debug_arg, clusterwide_opt)==1?0:1;
}
clvmd_set_debug(debug_opt);
clvmd_set_debug(debug_arg);
/* Fork into the background (unless requested not to) */
if (!foreground_mode)