1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-24 14:50:34 +03:00

dmsetup: [v2] return 0 for [--]{version,help}

Leverage 0b1c79642061 to cope with "dmsetup SubCommand --{help,version}"
and bail out directly when _report_init() fails.

Related: rhbz1393692
This commit is contained in:
Heinz Mauelshagen 2016-11-10 18:09:37 +01:00
parent 0b1c796420
commit b11f4f93d7

View File

@ -6798,7 +6798,7 @@ unknown:
if (_switches[COLS_ARG]) {
if (!_report_init(cmd, subcommand))
ret = 1;
if (!_report)
if (ret || !_report)
goto_out;
}
@ -6852,7 +6852,6 @@ doit:
}
} while (--_count);
ret = 0;
out:
if (_report)
dm_report_free(_report);
@ -6865,5 +6864,5 @@ out:
if (_initial_timestamp)
dm_timestamp_destroy(_initial_timestamp);
return ret;
return (_switches[HELP_ARG] || _switches[VERSION_ARG]) ? 0 : ret;
}