From 67aeaff06d7e4be1280392c14a824e6616bb316a Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed, 29 Nov 2017 18:49:15 -0800 Subject: [PATCH] f2fs-tools: allow multiple prog names This patch allows different prog names like fsck_f2fs, sload_f2fs, etc for android. Signed-off-by: Jaegeuk Kim --- fsck/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fsck/main.c b/fsck/main.c index 9d9cc0c..ba247d4 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -113,7 +113,15 @@ void f2fs_parse_options(int argc, char *argv[]) int option = 0; char *prog = basename(argv[0]); int err = NOERROR; +#ifdef WITH_ANDROID + int i; + /* Allow prog names (e.g, sload_f2fs, fsck_f2fs, etc) */ + for (i = 0; i < strlen(prog); i++) { + if (prog[i] == '_') + prog[i] = '.'; + } +#endif if (argc < 2) { MSG(0, "\tError: Device not specified\n"); error_out(prog); -- 2.7.4