From: Theodore Ts'o Date: Sun, 29 Jan 2006 10:15:36 +0000 (-0500) Subject: Add a config option which controls whether fs checks are skipped when on battery X-Git-Tag: E2FSPROGS-1.39-WIP-0330~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5f37a9b25191421e08bfd909e14b533333cf367;p=thirdparty%2Fe2fsprogs.git Add a config option which controls whether fs checks are skipped when on battery Whether fs checks are skipped when the system is running on battery can be controlled by the new e2fsck.conf option defer_check_on_battery (this option defaults to TRUE). Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 497a0cca9..a2bfcf981 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,7 +1,11 @@ 2006-01-29 Theodore Ts'o * unix.c (check_if_skip): When skipping a check due to being on - battery, print an explanatory message to this effect. + battery, print an explanatory message to this effect. Add + an e2fsck configuration option defer_check_on_battery + which defaults to true. If the configuration option is + turned off, then e2fsck will not attempt to defer + filesystem checks when the system is running on battery. (Addresses Debain Bug: #350306) 2006-01-06 Theodore Ts'o diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 4a7e08ae1..b3db14c97 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -259,7 +259,14 @@ static void check_if_skip(e2fsck_t ctx) unsigned int reason_arg = 0; long next_check; int batt = is_on_batt(); - + int defer_check_on_battery; + + profile_get_boolean(ctx->profile, "options", + "defer_check_on_battery", 0, 1, + &defer_check_on_battery); + if (!defer_check_on_battery) + batt = 0; + if ((ctx->options & E2F_OPT_FORCE) || bad_blocks_file || cflag || swapfs) return;