[PATCH 02/11] sadump: cleanup is_sadump()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make logic on diskset configuration readable.
---

 sadump.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/sadump.c b/sadump.c
index 3178c4c..0d7a935 100644
--- a/sadump.c
+++ b/sadump.c
@@ -623,17 +623,21 @@ open_disk(char *file)
 int is_sadump(char *file)
 {
 	if (SADUMP_VALID()) {
-		if (sd->flags & SADUMP_DISKSET) {
-			if (!open_disk(file) || !add_disk(file)) {
-				(void) sadump_cleanup_sadump_data();
-				return FALSE;
-			}
-			return TRUE;
+
+		if (!(sd->flags & SADUMP_DISKSET)) {
+			if (CRASHDEBUG(1))
+				error(INFO, "sadump: does not support multiple"
+				      " file formats\n");
+			(void) sadump_cleanup_sadump_data();
+			return FALSE;
 		}
-		if (CRASHDEBUG(1))
-			error(INFO, "sadump: does not support multiple file formats\n");
-		(void) sadump_cleanup_sadump_data();
-		return FALSE;
+
+		if (!open_disk(file) || !add_disk(file)) {
+			(void) sadump_cleanup_sadump_data();
+			return FALSE;
+		}
+
+		return TRUE;
 	}
 
 	if (!open_dump_file(file) || !read_dump_header(file))
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux