From c8675c49336ca08f00c9110df971258265ae2c29 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 3 Aug 2010 12:56:00 +0000 Subject: [PATCH] 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. --- WHATS_NEW_DM | 1 + tools/dmsetup.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 8c4a064f9..980899ef5 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.54 - ================================ + Fix return status 0 for "dmsetup info -c -o help". Add check for kernel semaphore support and disable udev_sync if not available. Version 1.02.53 - 28th July 2010 diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 10b9e0bd7..cca7424b1 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))