diff options
author | Theodore Ts'o <tytso@mit.edu> | 2001-06-14 01:16:17 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2001-06-14 01:16:17 +0000 |
commit | b6a0807b088e12777609728bb3f80490db58f8aa (patch) | |
tree | 20b798fddb1c25785359b94c501c0faaca888fa2 /e2fsck | |
parent | 6579488028f0fcd8173f49f11971ee0a4f9c99cb (diff) | |
download | e2fsprogs-b6a0807b088e12777609728bb3f80490db58f8aa.tar.gz |
ChangeLog, unix.c:
unix.c (check_if_skip): Adapted patch from Andreas Dilger which prints
the number of mounts or days elapsed since the last check when e2fsck
is forced to check an otherwise clean filesystem.
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/ChangeLog | 7 | ||||
-rw-r--r-- | e2fsck/unix.c | 22 |
2 files changed, 21 insertions, 8 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 7190cb8a..272c6403 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,10 @@ +2001-06-13 Theodore Tso <tytso@valinux.com> + + * unix.c (check_if_skip): Adapted patch from Andreas Dilger which + prints the number of mounts or days elapsed since the last + check when e2fsck is forced to check an otherwise clean + filesystem. + 2001-06-12 Theodore Tso <tytso@valinux.com> * badblocks.c: Stop using the compatibility badblocks function, diff --git a/e2fsck/unix.c b/e2fsck/unix.c index f7ed56d0..816f3cea 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -253,24 +253,30 @@ static void check_if_skip(e2fsck_t ctx) { ext2_filsys fs = ctx->fs; const char *reason = NULL; + unsigned int reason_arg = 0; if (force || bad_blocks_file || cflag || swapfs) return; if (fs->super->s_state & EXT2_ERROR_FS) - reason = _("contains a file system with errors"); + reason = _(" contains a file system with errors"); else if ((fs->super->s_state & EXT2_VALID_FS) == 0) - reason = _("was not cleanly unmounted"); + reason = _(" was not cleanly unmounted"); else if ((fs->super->s_max_mnt_count > 0) && (fs->super->s_mnt_count >= - (unsigned) fs->super->s_max_mnt_count)) - reason = _("has reached maximal mount count"); - else if (fs->super->s_checkinterval && + (unsigned) fs->super->s_max_mnt_count)) { + reason = _(" has been mounted %u times without being checked"); + reason_arg = fs->super->s_mnt_count; + } else if (fs->super->s_checkinterval && time(0) >= (fs->super->s_lastcheck + - fs->super->s_checkinterval)) - reason = _("has gone too long without being checked"); + fs->super->s_checkinterval)) { + reason = _(" has gone %u days without being checked"); + reason_arg = (time(0) - fs->super->s_lastcheck)/(3600*24); + } if (reason) { - printf(_("%s %s, check forced.\n"), ctx->device_name, reason); + fputs(ctx->device_name, stdout); + printf(reason, reason_arg); + fputs(_(", check forced.\n"), stdout); return; } printf(_("%s: clean, %d/%d files, %d/%d blocks\n"), ctx->device_name, |