]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - e2fsck/ehandler.c
e2fsck: check the error return from the forced rewrite write
[thirdparty/e2fsprogs.git] / e2fsck / ehandler.c
index 71ca301ca5fe8777d51ce1e2bbcc58484e05bdbd..14e954912606a6b8643fa17c7d18d58b1851930f 100644 (file)
@@ -31,6 +31,7 @@ static errcode_t e2fsck_handle_read_error(io_channel channel,
        int     i;
        char    *p;
        ext2_filsys fs = (ext2_filsys) channel->app_data;
+       errcode_t retval;
        e2fsck_t ctx;
 
        ctx = (e2fsck_t) fs->priv_data;
@@ -64,8 +65,13 @@ static errcode_t e2fsck_handle_read_error(io_channel channel,
                return 0;
 
        if (ask(ctx, _("Ignore error"), 1)) {
-               if (ask(ctx, _("Force rewrite"), 1))
-                       io_channel_write_blk64(channel, block, count, data);
+               if (ask(ctx, _("Force rewrite"), 1)) {
+                       retval = io_channel_write_blk64(channel, block,
+                                                       count, data);
+                       if (retval)
+                               printf(_("Error rewriting block %lu (%s)\n"),
+                                      block, error_message(retval));
+               }
                return 0;
        }