[PATCH 2/3] fsck.cramfs: clean up gcc warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Randy Dunlap <randy.dunlap@xxxxxxxxxx>

* 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@xxxxxxxxxx>
---
 disk-utils/fsck.cramfs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- util-linux-ng-2.13.orig/disk-utils/fsck.cramfs.c
+++ util-linux-ng-2.13/disk-utils/fsck.cramfs.c
@@ -232,7 +232,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) {
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux