master - vgimport/vgexport: return invalid cmd
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cf29de5de0a39ade491e18c1fe0e8bd3c2937b08 Commit: cf29de5de0a39ade491e18c1fe0e8bd3c2937b08 Parent: 5aa2e5ec8c8fcb279362c73983f09b4b50f706c0 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sun Mar 30 22:38:51 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sun Mar 30 23:40:27 2014 +0200
vgimport/vgexport: return invalid cmd
When option parsing fails, return invalid cmd instead of fail.
--- WHATS_NEW | 1 + tools/vgexport.c | 4 ++-- tools/vgimport.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.106 - ==================================== + Return proper invalid cmd when vgimport/exports find error in parameters. Obtain list of known VGs for pvchange --all when using lvmetad. Add man page for lvm dumpconfig. Drop unused cmd pointer for internal function for_each_sub_lv().
tools/vgexport.c +2 -2
@@ -56,12 +56,12 @@ int vgexport(struct cmd_context *cmd, int argc, char **argv) {if (!argc && !arg_count (cmd, all_ARG)) {log_error ("Please supply volume groups or use -a for all." ); -return ECMD_FAILED ; +return EINVALID_CMD_LINE ; }if (argc &&arg_count (cmd, all_ARG)) {log_error ("No arguments permitted when using -a for all." ); -return ECMD_FAILED ; +return EINVALID_CMD_LINE ; } return process_each_vg(cmd, argc, argv, READ_FOR_UPDATE, NULL,
tools/vgimport.c +2 -2
@@ -60,12 +60,12 @@ int vgimport(struct cmd_context *cmd, int argc, char **argv) {if (!argc && !arg_count (cmd, all_ARG)) {log_error ("Please supply volume groups or use -a for all." ); -return ECMD_FAILED ; +return EINVALID_CMD_LINE ; }if (argc &&arg_count (cmd, all_ARG)) {log_error ("No arguments permitted when using -a for all." ); -return ECMD_FAILED ; +return EINVALID_CMD_LINE ; }if (arg_count (cmd, force_ARG)) {