public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Kalpak Shah <Kalpak.Shah@Sun.COM>
To: TheodoreTso <tytso@mit.edu>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: [PATCH][2/15] e2fsprogs-config-before-cmdline.patch
Date: Mon, 06 Oct 2008 16:01:08 +0530	[thread overview]
Message-ID: <1223289068.4007.84.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

The patch changes the order that the config file and command line are
parsed so that command line has precedence.  It also adds a check to
make sure only one -E option is passed on the command line as -E option
parsing is not cumulative.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <adilger@sun.com>


[-- Attachment #2: e2fsprogs-config-before-cmdline.patch --]
[-- Type: text/x-patch, Size: 1602 bytes --]

The patch changes the order that the config file and command line are
parsed so that command line has precedence.  It also adds a check to
make sure only one -E option is passed on the command line as -E option
parsing is not cumulative.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>

Index: e2fsprogs-1.40.11/e2fsck/unix.c
===================================================================
--- e2fsprogs-1.40.11.orig/e2fsck/unix.c
+++ e2fsprogs-1.40.11/e2fsck/unix.c
@@ -589,7 +589,6 @@ static errcode_t PRS(int argc, char *arg
 #ifdef HAVE_SIGNAL_H
 	struct sigaction	sa;
 #endif
-	char		*extended_opts = 0;
 	char		*cp;
 	int 		res;		/* result of sscanf */
 #ifdef CONFIG_JBD_DEBUG
@@ -620,6 +619,12 @@ static errcode_t PRS(int argc, char *arg
 		ctx->program_name = *argv;
 	else
 		ctx->program_name = "e2fsck";
+
+	if ((cp = getenv("E2FSCK_CONFIG")) != NULL)
+		config_fn[0] = cp;
+	profile_set_syntax_err_cb(syntax_err_report);
+	profile_init(config_fn, &ctx->profile);
+
 	while ((c = getopt (argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDk")) != EOF)
 		switch (c) {
 		case 'C':
@@ -650,7 +655,7 @@ static errcode_t PRS(int argc, char *arg
 			ctx->options |= E2F_OPT_COMPRESS_DIRS;
 			break;
 		case 'E':
-			extended_opts = optarg;
+			parse_extended_opts(ctx, optarg);
 			break;
 		case 'p':
 		case 'a':
@@ -777,13 +782,6 @@ static errcode_t PRS(int argc, char *arg
 		fatal_error(ctx, 0);
 	}
 	ctx->filesystem_name = string_copy(ctx, ctx->filesystem_name, 0);
-	if (extended_opts)
-		parse_extended_opts(ctx, extended_opts);

             reply	other threads:[~2008-10-06 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 10:31 Kalpak Shah [this message]
2008-10-06 20:49 ` [PATCH][2/15] e2fsprogs-config-before-cmdline.patch Theodore Tso
2008-10-07  8:56   ` Andreas Dilger

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=1223289068.4007.84.camel@localhost \
    --to=kalpak.shah@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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