master - pvck: Use non-zero exit status after failure.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=efe5245e47201e1947ce0bf60990a7de2151e296 Commit: efe5245e47201e1947ce0bf60990a7de2151e296 Parent: c3e29903590b596bfead1d84f91a32362d8e640f Author: Alasdair G Kergon <[email protected]> AuthorDate: Thu Nov 13 12:26:43 2014 +0000 Committer: Alasdair G Kergon <[email protected]> CommitterDate: Thu Nov 13 12:26:43 2014 +0000
pvck: Use non-zero exit status after failure.
--- WHATS_NEW | 1 + tools/pvck.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.113 - ===================================== + Exit with non-zero status code when pvck encounters a problem. Fix clean_tree after activation/resume for cache target (2.02.112). Version 2.02.112 - 11th November 2014
tools/pvck.c +8 -4
@@ -18,9 +18,11 @@int pvck (struct cmd_context *cmd,int argc,char **argv) {int i; +int ret_max =ECMD_PROCESSED ;/* FIXME: validate cmdline options */ /* FIXME: what does the cmdline look like? */ +/* * Use what's on the cmdline directly, and avoid calling into * some of the other infrastructure functions, so as to avoid
@@ -32,10 +34,12 @@ int pvck(struct cmd_context *cmd, int argc, char **argv)log_verbose ("Scanning %s" , argv[i]);dm_unescape_colons_and_at_signs (argv[i],NULL ,NULL ); -pv_analyze (cmd, argv[i], -arg_uint64_value (cmd, labelsector_ARG, -UINT64_C (0 ))); +if (!pv_analyze (cmd, argv[i], +arg_uint64_value (cmd, labelsector_ARG,UINT64_C (0 )))) { + stack; + ret_max =ECMD_FAILED ; + } } -return ECMD_PROCESSED ; +return ret_max; }