]> err.no Git - util-linux/commitdiff
fsck.cramfs: clean up gcc warnings
authorRandy Dunlap <randy.dunlap@oracle.com>
Sat, 29 Sep 2007 08:11:47 +0000 (01:11 -0700)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Oct 2007 21:08:34 +0000 (23:08 +0200)
* clean up code, gcc warnings
  (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2")

Builds cleanly on x86_32 and x86_64.

fsck.cramfs.c:235: warning: ignoring return value of 'read', declared with attribute warn_unused_result

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
disk-utils/fsck.cramfs.c

index 117ee6e2f23360fb74d55adccdba260503cb12a4..2a63ac9022da1a75073254ba7d459b90a632188e 100644 (file)
@@ -231,7 +231,8 @@ static void test_crc(int start)
                buf = mmap(NULL, super.size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                if (buf != MAP_FAILED) {
                        lseek(fd, 0, SEEK_SET);
-                       read(fd, buf, super.size);
+                       if (read(fd, buf, super.size) < 0)
+                               die(FSCK_ERROR, 1, "read failed: %s", filename);
                }
        }
        if (buf != MAP_FAILED) {