Skip to contentSkip to conversation

fsck.f2fs: allow -p without value

PATCH In review Jaegeuk Kim 2 participants 2 messages Jan 31, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsck.f2fs: allow -p without value

This patch allows -p without value.

---
 fsck/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fsck/main.c +4 -4
index f35d01d..804f71a 100644
@@ -184,13 +184,13 @@ void f2fs_parse_options(int argc, char *argv[])
 				 *  0: default level, the same as -a
 				 *  1: check meta
 				 */
-				if (optarg[0] == '-') {
+				if (optarg[0] == '-' || !is_digits(optarg) ||
+							optind == argc) {
+					MSG(0, "Info: Use default preen mode\n");
 					c.preen_mode = PREEN_MODE_0;
+					c.auto_fix = 1;
 					optind--;
 					break;
-				} else if (!is_digits(optarg)) {
-					err = EWRONG_OPT;
-					break;
 				}
 				c.preen_mode = atoi(optarg);
 				if (c.preen_mode < 0)
Signature · 6 lines
2.15.0.531.g2ccb3012c9-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot