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

Fix pvs, vgs, lvs error exit status on some error paths.

(note -o help is now considered error)
This commit is contained in:
Alasdair Kergon 2008-01-20 01:23:46 +00:00
parent ad1fc08312
commit 8a19ebf4fb
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.32 -
===================================
Fix pvs, vgs, lvs error exit status on some error paths.
Version 2.02.31 - 19th January 2008
===================================

View File

@ -240,13 +240,13 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
opts = arg_str_value(cmd, options_ARG, "");
if (!opts || !*opts) {
log_error("Invalid options string: %s", opts);
return 0;
return EINVALID_CMD_LINE;
}
if (*opts == '+') {
if (!(str = dm_pool_alloc(cmd->mem,
strlen(options) + strlen(opts) + 1))) {
log_error("options string allocation failed");
return 0;
return ECMD_FAILED;
}
strcpy(str, options);
strcat(str, ",");
@ -273,8 +273,10 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
if (!(report_handle = report_init(cmd, options, keys, &report_type,
separator, aligned, buffered,
headings)))
return_0;
headings))) {
stack;
return ECMD_FAILED;
}
/* Ensure options selected are compatible */
if (report_type & SEGS)
@ -284,7 +286,7 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
if ((report_type & LVS) && (report_type & PVS) && !args_are_pvs) {
log_error("Can't report LV and PV fields at the same time");
dm_report_free(report_handle);
return 0;
return ECMD_FAILED;
}
/* Change report type if fields specified makes this necessary */