diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2014-11-28 15:04:25 +0100 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2015-02-10 16:05:29 +0100 |
commit | 56011918e66adf1f639436fd6781a89ad61eb8f4 (patch) | |
tree | 632a56c09f6e2d366b73f870ccd2873ea3ce8c96 /tools/pvresize.c | |
parent | a91bc7a19b8f439fa1d21101ad5c11d72413d4c0 (diff) | |
download | lvm2-56011918e66adf1f639436fd6781a89ad61eb8f4.tar.gz |
toollib: initialize handles (including reporting for selection) for _select_match_* used in process_each_* fns
Call _init_processing_handle, _init_selection_handle and
_destroy_processing_handle in process_each_* and related functions to
set up and destroy handles used while processing items.
Diffstat (limited to 'tools/pvresize.c')
-rw-r--r-- | tools/pvresize.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/pvresize.c b/tools/pvresize.c index a2f6b8bf4..f6253d985 100644 --- a/tools/pvresize.c +++ b/tools/pvresize.c @@ -50,16 +50,18 @@ int pvresize(struct cmd_context *cmd, int argc, char **argv) struct processing_handle handle = { .internal_report_for_select = 1, .selection_handle = NULL, .custom_handle = ¶ms }; - int ret; + int ret = ECMD_PROCESSED; if (!argc) { log_error("Please supply physical volume(s)"); - return EINVALID_CMD_LINE; + ret = EINVALID_CMD_LINE; + goto out; } if (arg_sign_value(cmd, physicalvolumesize_ARG, SIGN_NONE) == SIGN_MINUS) { log_error("Physical volume size may not be negative"); - return EINVALID_CMD_LINE; + ret = EINVALID_CMD_LINE; + goto out; } params.new_size = arg_uint64_value(cmd, physicalvolumesize_ARG, @@ -73,6 +75,7 @@ int pvresize(struct cmd_context *cmd, int argc, char **argv) log_print_unless_silent("%d physical volume(s) resized / %d physical volume(s) " "not resized", params.done, params.total - params.done); - +out: + destroy_processing_handle(cmd, &handle, 0); return ret; } |