@@ -292,7 +292,7 @@ may not be specified at the same time as the
.B \-n
or
.B \-p
-options.
+options. If given twice, will answer `no' to any `Abort?' question.
.SH EXIT CODE
The exit code returned by
.B e2fsck
@@ -155,6 +155,7 @@ struct resource_track {
#define E2F_OPT_WRITECHECK 0x0200
#define E2F_OPT_COMPRESS_DIRS 0x0400
#define E2F_OPT_FRAGCHECK 0x0800
+#define E2F_OPT_YESYES 0x1000
/*
* E2fsck flags
@@ -1843,9 +1843,20 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
answer = 1;
else
answer = 0;
- } else
- answer = ask(ctx, (ptr->prompt == PROMPT_NULL) ? "" :
+ } else {
+ /*
+ * yesmeansno:
+ * e2fsck -y -y really means yes, don't abort!
+ */
+ if ((ptr->prompt == PROMPT_ABORT) &&
+ (ctx->options & E2F_OPT_YESYES)) {
+ printf (_("%s? no\n\n"), _(prompt[(int) ptr->prompt]));
+ answer = 0;
+ } else {
+ answer = ask(ctx, (ptr->prompt == PROMPT_NULL) ? "" :
_(prompt[(int) ptr->prompt]), def_yn);
+ }
+ }
if (!answer && !(ptr->flags & PR_NO_OK))
ext2fs_unmark_valid(fs);
@@ -709,6 +709,10 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
case 'y':
if (ctx->options & (E2F_OPT_PREEN|E2F_OPT_NO))
goto conflict_opt;
+ if (ctx->options & (E2F_OPT_YES)) {
+ printf("yesyes\n");
+ ctx->options |= E2F_OPT_YESYES;
+ }
ctx->options |= E2F_OPT_YES;
break;
case 't':
RH Bug 484913 - Change verbage of e2fsck questioning to make the "-y" switch more useful demonstrates: sh-3.2# e2fsck -y /dev/VolGroup00/VolVol02 e2fsck 1.41.3 (12-Oct-2008) The filesystem size (according to the superblock) is 14090240 blocks The physical size of the device is 8847360 blocks Either the superblock or the partition table is likely to be corrupt! Abort? yes "-y" generally means yes, take the corrective action but in this case it stops fsck. Below is a little hacky, but makes -y -y answer "no" to "Abort?" I'm open to a better method if anyone has a suggestion. Signed-off-by: Eric Sandeen <sandeen@redhat.com> --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html