mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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:
parent
ad1fc08312
commit
8a19ebf4fb
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.32 -
|
Version 2.02.32 -
|
||||||
===================================
|
===================================
|
||||||
|
Fix pvs, vgs, lvs error exit status on some error paths.
|
||||||
|
|
||||||
Version 2.02.31 - 19th January 2008
|
Version 2.02.31 - 19th January 2008
|
||||||
===================================
|
===================================
|
||||||
|
@ -240,13 +240,13 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
|
|||||||
opts = arg_str_value(cmd, options_ARG, "");
|
opts = arg_str_value(cmd, options_ARG, "");
|
||||||
if (!opts || !*opts) {
|
if (!opts || !*opts) {
|
||||||
log_error("Invalid options string: %s", opts);
|
log_error("Invalid options string: %s", opts);
|
||||||
return 0;
|
return EINVALID_CMD_LINE;
|
||||||
}
|
}
|
||||||
if (*opts == '+') {
|
if (*opts == '+') {
|
||||||
if (!(str = dm_pool_alloc(cmd->mem,
|
if (!(str = dm_pool_alloc(cmd->mem,
|
||||||
strlen(options) + strlen(opts) + 1))) {
|
strlen(options) + strlen(opts) + 1))) {
|
||||||
log_error("options string allocation failed");
|
log_error("options string allocation failed");
|
||||||
return 0;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
strcpy(str, options);
|
strcpy(str, options);
|
||||||
strcat(str, ",");
|
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,
|
if (!(report_handle = report_init(cmd, options, keys, &report_type,
|
||||||
separator, aligned, buffered,
|
separator, aligned, buffered,
|
||||||
headings)))
|
headings))) {
|
||||||
return_0;
|
stack;
|
||||||
|
return ECMD_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ensure options selected are compatible */
|
/* Ensure options selected are compatible */
|
||||||
if (report_type & SEGS)
|
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) {
|
if ((report_type & LVS) && (report_type & PVS) && !args_are_pvs) {
|
||||||
log_error("Can't report LV and PV fields at the same time");
|
log_error("Can't report LV and PV fields at the same time");
|
||||||
dm_report_free(report_handle);
|
dm_report_free(report_handle);
|
||||||
return 0;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Change report type if fields specified makes this necessary */
|
/* Change report type if fields specified makes this necessary */
|
||||||
|
Loading…
Reference in New Issue
Block a user