]> www.infradead.org Git - mtd-utils.git/commitdiff
ubi-tools: fix ubinize
authorAdrian Hunter <ext-adrian.hunter@nokia.com>
Thu, 31 Jan 2008 15:21:57 +0000 (17:21 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 1 Feb 2008 09:14:12 +0000 (11:14 +0200)
ubinize reserves 2 eraseblocks for the volume table at the start of the
output file and then never seeked back to the start of the file.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/src/ubinize.c

index 4c3fd97ce885c061bc832ff32331219613139b46..9660b09e1b1c0919007272e26fbac7c5e5960671 100644 (file)
@@ -618,6 +618,11 @@ int main(int argc, char * const argv[])
 
        verbose(args.verbose, "writing layout volume");
 
+       if (fseek(args.fp_out, 0, SEEK_SET) == -1) {
+               errmsg("cannot seek file \"%s\"", args.f_out);
+               goto out_dict;
+       }
+
        err = ubigen_write_layout_vol(&ui, vtbl, args.fp_out);
        if (err) {
                errmsg("cannot write layout volume");