mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: report: return immediately from dm_report_compact_fields without error if there are no rows
Let's make dm_report_compact_fields consistent with dm_report_output fn which also returns with success immediately if there are no rows.
This commit is contained in:
parent
f867dc6b29
commit
42d71b9af3
@ -1696,11 +1696,12 @@ int dm_report_compact_fields(struct dm_report *rh)
|
||||
struct field_properties *fp;
|
||||
struct row *row;
|
||||
|
||||
if (!(rh->flags & DM_REPORT_OUTPUT_BUFFERED))
|
||||
if (!(rh->flags & DM_REPORT_OUTPUT_BUFFERED) ||
|
||||
dm_list_empty(&rh->rows))
|
||||
return 1;
|
||||
|
||||
if (!rh || dm_list_empty(&rh->rows)) {
|
||||
log_error("dm_report_enable_compact_output: no report fields to compact");
|
||||
if (!rh) {
|
||||
log_error("dm_report_enable_compact_output: dm report handler is NULL.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user