mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
lvrename: fix exit code
Return invalid cmd line (3) when error is detect on cmd line input. Cmd failed (5) is used when command processing fails.
This commit is contained in:
parent
80fe100afa
commit
28e4bf0b6d
@ -1,5 +1,6 @@
|
||||
Version 2.02.106 -
|
||||
====================================
|
||||
When lvrename fails on argument parsing return invalid cmd line error (5->3).
|
||||
Fix exit code regression in failing pvchange command (2.02.66).
|
||||
Include 'lvm dumpconfig --type missing' and '--type diff' output to lvmdump.
|
||||
Return failure when specifying negative size for pvresize.
|
||||
|
@ -75,16 +75,18 @@ int lvrename(struct cmd_context *cmd, int argc, char **argv)
|
||||
if (strlen(lv_name_new) > maxlen) {
|
||||
log_error("New logical volume path exceeds maximum length "
|
||||
"of %" PRIsize_t "!", maxlen);
|
||||
return ECMD_FAILED;
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
if (!*lv_name_new) {
|
||||
log_error("New logical volume name may not be blank");
|
||||
return ECMD_FAILED;
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
if (!apply_lvname_restrictions(lv_name_new))
|
||||
return_ECMD_FAILED;
|
||||
if (!apply_lvname_restrictions(lv_name_new)) {
|
||||
stack;
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
if (!validate_name(lv_name_new)) {
|
||||
log_error("New logical volume name \"%s\" is invalid",
|
||||
|
Loading…
x
Reference in New Issue
Block a user