From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH] fsck.f2fs: allow -p without value
Date: Tue, 30 Jan 2018 17:26:07 -0800 [thread overview]
Message-ID: <20180131012607.85117-1-jaegeuk@kernel.org> (raw)
This patch allows -p without value.
Suggested-by: Pavol Cupka <pavol.cupka@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fsck/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fsck/main.c b/fsck/main.c
index f35d01d..804f71a 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -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)
--
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
next reply other threads:[~2018-01-31 1:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 1:26 Jaegeuk Kim [this message]
2018-01-31 10:05 ` [PATCH] fsck.f2fs: allow -p without value Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180131012607.85117-1-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).