From: Jaegeuk Kim Subject: [PATCH 4/6] f2fs-tools: allow multiple prog names Date: Thu, 30 Nov 2017 21:51:55 -0800 Message-ID: <20171201055157.72846-4-jaegeuk@kernel.org> References: <20171201055157.72846-1-jaegeuk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eKeFH-0003I3-On for linux-f2fs-devel@lists.sourceforge.net; Fri, 01 Dec 2017 05:52:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) id 1eKeFH-0004B2-4H for linux-f2fs-devel@lists.sourceforge.net; Fri, 01 Dec 2017 05:52:19 +0000 In-Reply-To: <20171201055157.72846-1-jaegeuk@kernel.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim 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.15.0.403.gc27cc4dac6-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot