lvm2/lvm2-2_02_99-fix-dmsetup-splitname-to-not-fail-if-used-without-c-switch.patch

48 lines
1.5 KiB
Diff

commit f03877ecb56f32d91dd98e8e3331164f472f8b77
Author: Peter Rajnoha <prajnoha@redhat.com>
Date: Tue May 14 11:48:51 2013 +0200
lvm2-2_02_99-fix-dmsetup-splitname-to-not-fail-if-used-without-c-switch.patch
---
WHATS_NEW_DM | 1 +
tools/dmsetup.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 30d01f9..34a0f70 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.78 -
===================================
+ Fix 'dmsetup splitname -o' to not fail if used without '-c' switch (1.02.68).
Close open dmeventd FIFO file descriptors on exec (FD_CLOEXEC).
Add DM_DISABLE_UDEV environment variable to manage dev nodes by libdm only.
Automatically deactivate failed preloaded dm tree node.
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 196c170..2dc3abd 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -3749,9 +3749,6 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir)
return 0;
}
- if (!_process_options(_string_args[OPTIONS_ARG]))
- return 0;
-
if (_switches[TABLE_ARG] && _switches[NOTABLE_ARG]) {
fprintf(stderr, "--table and --notable are incompatible.\n");
return 0;
@@ -3824,6 +3821,11 @@ int main(int argc, char **argv)
if (!strcmp(cmd->name, "mangle"))
dm_set_name_mangling_mode(DM_STRING_MANGLING_NONE);
+ if (!_process_options(_string_args[OPTIONS_ARG])) {
+ fprintf(stderr, "Couldn't process command line.\n");
+ goto out;
+ }
+
if (_switches[COLS_ARG]) {
if (!_report_init(cmd))
goto out;