]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
ChangeLog, util.c:
authorTheodore Ts'o <tytso@mit.edu>
Fri, 12 Jan 2001 20:59:19 +0000 (20:59 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 12 Jan 2001 20:59:19 +0000 (20:59 +0000)
  util.c (fatal_error): Check to make sure the io_manager data structure
   is sane before trying to flush the io_channel.  (From Andreas Dilger)

e2fsck/ChangeLog
e2fsck/util.c

index 4a473ede58963c16e74c6973cce83cb152181c89..df1d0c2af48de10d0864a5fa439461e5168969bd 100644 (file)
@@ -1,5 +1,9 @@
 2001-01-12  Theodore Ts'o  <tytso@valinux.com>
 
+       * util.c (fatal_error): Check to make sure the io_manager data
+               structure is sane before trying to flush the io_channel.
+               (From Andreas Dilger)
+
        * pass2.c: Minor whitespace cleanups, from Andreas Dilger.
 
        * journal.c (e2fsck_journal_fix_bad_inode): Set pctx->ino to the
index 1e2f9f0c4db26ed7d96790cb6a0e83aa0659be79..517aa6ecec2510cdba7e41d2204a75752ff1a041 100644 (file)
@@ -41,6 +41,12 @@ void fatal_error(e2fsck_t ctx, const char *msg)
                fprintf (stderr, "e2fsck: %s\n", msg);
        if (ctx->fs && ctx->fs->io)
                io_channel_flush(ctx->fs->io);
+       if (ctx->fs && ctx->fs->io) {
+               if (ctx->fs->io->magic == EXT2_ET_MAGIC_IO_MANAGER)
+                       io_channel_flush(ctx->fs->io);
+               else
+                       fprintf(stderr, "e2fsck: io manager magic bad!\n");
+       }
        ctx->flags |= E2F_FLAG_ABORT;
        if (ctx->flags & E2F_FLAG_SETJMP_OK)
                longjmp(ctx->abort_loc, 1);