jffs2mark did not check the return code properly
authorJohn Crispin <blogic@openwrt.org>
Mon, 7 Apr 2014 10:53:59 +0000 (11:53 +0100)
committerJohn Crispin <blogic@openwrt.org>
Mon, 7 Apr 2014 12:27:38 +0000 (13:27 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
jffs2reset.c

index 0673982..122e03b 100644 (file)
@@ -124,7 +124,7 @@ jffs2_mark(int argc, char **argv)
        sz = write(fd, &deadc0de, sizeof(deadc0de));
        close(fd);
 
        sz = write(fd, &deadc0de, sizeof(deadc0de));
        close(fd);
 
-       if (sz != 1) {
+       if (sz != 4) {
                fprintf(stderr, "writing %s failed: %s\n", v->blk, strerror(errno));
                return -1;
        }
                fprintf(stderr, "writing %s failed: %s\n", v->blk, strerror(errno));
                return -1;
        }