Whamcloud - gitweb
tune2fs: fix an error message
[tools/e2fsprogs.git] / misc / tune2fs.c
index 98e3898..f3ce443 100644 (file)
@@ -3105,7 +3105,9 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
                if (retval) {
                        com_err("tune2fs", retval,
                                "while recovering journal.\n");
-                       printf(_("Please run e2fsck -fy %s.\n"), argv[1]);
+                       printf(_("Please run e2fsck -fy %s.\n"), device_name);
+                       if (!fs)
+                               exit(1);
                        rc = 1;
                        goto closefs;
                }
@@ -3243,6 +3245,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
                        fputs(_("Error in using clear_mmp. "
                                "It must be used with -f\n"),
                              stderr);
+                       rc = 1;
                        goto closefs;
                }
        }
@@ -3447,5 +3450,5 @@ closefs:
 
        if (feature_64bit)
                convert_64bit(fs, feature_64bit);
-       return (ext2fs_close_free(&fs) ? 1 : 0);
+       return (ext2fs_close_free(&fs) ? 1 : rc);
 }