]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck.cramfs: don't ignore read() result [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 4 Oct 2016 13:53:55 +0000 (15:53 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Oct 2016 13:53:55 +0000 (15:53 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fsck.cramfs.c

index d904037d388ee18f1d2399fa096b7d35e5bcf960..12009f21c3ee71fe7719b76b7f7a29ade681e9b3 100644 (file)
@@ -225,7 +225,7 @@ static void test_crc(int start)
                if (buf != MAP_FAILED) {
                        if (lseek(fd, 0, SEEK_SET) == (off_t) -1)
                                err(FSCK_EX_ERROR, _("seek on %s failed"), filename);
-                       if (read(fd, buf, super.size) < 0)
+                       if (read(fd, buf, super.size) != (ssize_t) super.size)
                                err(FSCK_EX_ERROR, _("cannot read %s"), filename);
                }
        }