summaryrefslogtreecommitdiff
path: root/e2fsck/problem.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-01-04 13:59:04 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-01-04 13:59:04 -0500
commitc70674387ee0c038bca16098f7869181beeabe0a (patch)
tree7b904f8aa5ab37c450b8f5c6e879633f93f8fa1a /e2fsck/problem.c
parentbbb60e4fefdd404d8d696369804b556b404bb0c1 (diff)
downloade2fsprogs-c70674387ee0c038bca16098f7869181beeabe0a.tar.gz
e2fsck: Add new e2fsck.conf option: broken_system_clock
The broken_system_clock allows the time to be in the future when in preen mode. It's useful for people who have, as the name implies, broken system clocks. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck/problem.c')
-rw-r--r--e2fsck/problem.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index a713f1b2..9043281d 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -1741,7 +1741,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
struct e2fsck_problem *ptr;
struct latch_descr *ldesc = 0;
const char *message;
- int def_yn, answer, ans;
+ int def_yn, answer, ans, broken_system_clock;
int print_answer = 0;
int suppress = 0;
@@ -1753,6 +1753,15 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx)
if (!(ptr->flags & PR_CONFIG)) {
char key[9], *new_desc;
+ if ((code == PR_0_FUTURE_SB_LAST_MOUNT) ||
+ (code == PR_0_FUTURE_SB_LAST_WRITE)) {
+ profile_get_boolean(ctx->profile, "options",
+ "broken_system_clock", 0, 0,
+ &broken_system_clock);
+ if (broken_system_clock)
+ ptr->flags |= PR_PREEN_OK;
+ }
+
sprintf(key, "0x%06x", code);
profile_get_string(ctx->profile, "problems", key,