mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-04 07:23:33 +08:00
Print an error if more than one of the -p/-a, -n or -y options
are passed to e2fsck.
This commit is contained in:
parent
68ef5e1f4c
commit
8161a7484f
@ -1,3 +1,8 @@
|
|||||||
|
2003-11-19 Theodore Ts'o <tytso@mit.edu>
|
||||||
|
|
||||||
|
* unix.c (PRS): Print an error if more than one of the -p/-a, -n
|
||||||
|
or -y options are specified.
|
||||||
|
|
||||||
2002-11-12 Theodore Ts'o <tytso@mit.edu>
|
2002-11-12 Theodore Ts'o <tytso@mit.edu>
|
||||||
|
|
||||||
* problem.c: Make HTREE problems PR_PREEN_OK, so that we don't
|
* problem.c: Make HTREE problems PR_PREEN_OK, so that we don't
|
||||||
|
@ -560,16 +560,22 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
|
|||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
case 'a':
|
case 'a':
|
||||||
|
if (ctx->options & (E2F_OPT_YES|E2F_OPT_NO)) {
|
||||||
|
conflict_opt:
|
||||||
|
fatal_error(ctx,
|
||||||
|
_("Only one the options -p/-a, -n or -y may be specified."));
|
||||||
|
}
|
||||||
ctx->options |= E2F_OPT_PREEN;
|
ctx->options |= E2F_OPT_PREEN;
|
||||||
ctx->options &= ~(E2F_OPT_YES|E2F_OPT_NO);
|
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
|
if (ctx->options & (E2F_OPT_YES|E2F_OPT_PREEN))
|
||||||
|
goto conflict_opt;
|
||||||
ctx->options |= E2F_OPT_NO;
|
ctx->options |= E2F_OPT_NO;
|
||||||
ctx->options &= ~(E2F_OPT_YES|E2F_OPT_PREEN);
|
|
||||||
break;
|
break;
|
||||||
case 'y':
|
case 'y':
|
||||||
|
if (ctx->options & (E2F_OPT_PREEN|E2F_OPT_NO))
|
||||||
|
goto conflict_opt;
|
||||||
ctx->options |= E2F_OPT_YES;
|
ctx->options |= E2F_OPT_YES;
|
||||||
ctx->options &= ~(E2F_OPT_PREEN|E2F_OPT_NO);
|
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
#ifdef RESOURCE_TRACK
|
#ifdef RESOURCE_TRACK
|
||||||
|
Loading…
Reference in New Issue
Block a user