]> www.infradead.org Git - mtd-utils.git/commitdiff
ubiformat: nicify error messages
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 16 Jan 2009 13:30:40 +0000 (15:30 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 16 Jan 2009 13:34:28 +0000 (15:34 +0200)
In case of error, ubiformat prints error messages at the same
line as the previous messages. Fix this.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/new-utils/src/ubiformat.c

index 7a6d1b7fadf4e2623fa23a3777241ea7644213c7..bf07e5e0291b133a3b1b15eebf30393a1f142370 100644 (file)
@@ -506,6 +506,8 @@ static int format(const struct mtd_info *mtd, const struct ubigen_info *ui,
 
                err = mtd_erase(mtd, eb);
                if (err) {
+                       if (!args.quiet)
+                               printf("\n");
                        sys_errmsg("failed to erase eraseblock %d", eb);
                        goto out_free;
                }
@@ -530,6 +532,8 @@ static int format(const struct mtd_info *mtd, const struct ubigen_info *ui,
 
                err = mtd_write(mtd, eb, 0, hdr, write_size);
                if (err) {
+                       if (!args.quiet && !args.verbose)
+                               printf("\n");
                        sys_errmsg("cannot write EC header (%d bytes buffer) to eraseblock %d",
                                   write_size, eb);
                        if (args.subpage_size != mtd->min_io_size)