Skip to contentSkip to conversation

f2fs-tools: skipped to end on error syntax error

PATCH New Robin Hsu 1 participant 1 message Nov 11, 2020

lore
Share & tools
lore

Robin Hsu

author
#0 lore raw

PATCH 1/1 f2fs-tools: skipped to end on error syntax error

From: Robin Hsu <[email protected]>

When error were found, we won't need to do any initialization but just quit.

---
 fsck/main.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
fsck/main.c +13 -11
index 32559f1..e70048b 100644
@@ -597,20 +597,22 @@ void f2fs_parse_options(int argc, char *argv[])
 		}
 	}
 
-	add_default_options();
+	if (err == NOERROR) {
+		add_default_options();
 
-	if (optind >= argc) {
-		MSG(0, "\tError: Device not specified\n");
-		error_out(prog);
-	}
+		if (optind >= argc) {
+			MSG(0, "\tError: Device not specified\n");
+			error_out(prog);
+		}
 
-	c.devices[0].path = strdup(argv[optind]);
-	if (argc > (optind + 1)) {
-		c.dbg_lv = 0;
-		err = EUNKNOWN_ARG;
+		c.devices[0].path = strdup(argv[optind]);
+		if (argc > (optind + 1)) {
+			c.dbg_lv = 0;
+			err = EUNKNOWN_ARG;
+		}
+		if (err == NOERROR)
+			return;
 	}
-	if (err == NOERROR)
-		return;
 
 	/* print out error */
 	switch (err) {
Signature · 1 line
2.29.2.222.g5d2a92d10f8-goog