summaryrefslogtreecommitdiffstats
path: root/tools/dmsetup.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2010-08-03 12:56:00 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2010-08-03 12:56:00 +0000
commitc8675c49336ca08f00c9110df971258265ae2c29 (patch)
treeb2d28122f0bc899ea08baf1352399c6d877c0564 /tools/dmsetup.c
parentd87427446c6323db78269729913d1fc16238a586 (diff)
downloadlvm2-c8675c49336ca08f00c9110df971258265ae2c29.tar.gz
lvm2-c8675c49336ca08f00c9110df971258265ae2c29.tar.xz
lvm2-c8675c49336ca08f00c9110df971258265ae2c29.zip
Fix return status 0 for "dmsetup info -c -o help".
Solution returns success for _report_init when help is passed, and caller needs to check for _report existance.
Diffstat (limited to 'tools/dmsetup.c')
-rw-r--r--tools/dmsetup.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 10b9e0bd..cca7424b 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -2652,6 +2652,9 @@ static int _report_init(struct command *c)
r = 1;
out:
+ if (!strcasecmp(options, "help") || !strcmp(options, "?"))
+ r = 1;
+
if (len)
dm_free(options);
@@ -3360,8 +3363,15 @@ int main(int argc, char **argv)
if (!_switches[COLS_ARG] && !strcmp(c->name, "splitname"))
_switches[COLS_ARG]++;
- if (_switches[COLS_ARG] && !_report_init(c))
- goto out;
+ if (_switches[COLS_ARG]) {
+ if (!_report_init(c))
+ goto out;
+ if (!_report) {
+ if (!strcmp(c->name, "info"))
+ r = 0; /* info -c -o help */
+ goto out;
+ }
+ }
#ifdef UDEV_SYNC_SUPPORT
if (!_set_up_udev_support(dev_dir))