Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck_msdos Cast read()/write() result to size_t to make...



details:   https://anonhg.NetBSD.org/src/rev/a7df0d046cb3
branches:  trunk
changeset: 365772:a7df0d046cb3
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Apr 24 10:35:15 2022 +0000

description:
Cast read()/write() result to size_t to make this compile again.

diffstat:

 sbin/fsck_msdos/boot.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 126325540176 -r a7df0d046cb3 sbin/fsck_msdos/boot.c
--- a/sbin/fsck_msdos/boot.c    Sun Apr 24 09:55:48 2022 +0000
+++ b/sbin/fsck_msdos/boot.c    Sun Apr 24 10:35:15 2022 +0000
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: boot.c,v 1.24 2022/04/23 22:40:28 mlelstv Exp $");
+__RCSID("$NetBSD: boot.c,v 1.25 2022/04/24 10:35:15 hannken Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -132,7 +132,8 @@
 
                if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET)
                    != boot->FSInfo * boot->BytesPerSec
-                   || read(dosfs, fsinfo, 2 * secsize) != 2 * secsize) {
+                   || (size_t)read(dosfs, fsinfo, 2 * secsize)
+                   != 2 * secsize) {
                        perr("could not read fsinfo block");
                        return FSFATAL;
                }
@@ -181,7 +182,7 @@
 
                if (lseek(dosfs, boot->Backup * boot->BytesPerSec, SEEK_SET)
                    != boot->Backup * boot->BytesPerSec
-                   || read(dosfs, backup, secsize) != secsize) {
+                   || (size_t)read(dosfs, backup, secsize) != secsize) {
                        perr("could not read backup bootblock");
                        free(fsinfo);
                        free(backup);
@@ -307,7 +308,8 @@
 
        if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET)
            != boot->FSInfo * boot->BytesPerSec
-           || read(dosfs, fsinfo, 2 * boot->BytesPerSec) != 2 * boot->BytesPerSec) {
+           || (size_t)read(dosfs, fsinfo, 2 * boot->BytesPerSec)
+           != 2 * boot->BytesPerSec) {
                perr("could not read fsinfo block");
                free(fsinfo);
                return FSFATAL;
@@ -322,7 +324,8 @@
        fsinfo[0x1ef] = (u_char)(boot->FSNext >> 24);
        if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET)
            != boot->FSInfo * boot->BytesPerSec
-           || write(dosfs, fsinfo, 2 * boot->BytesPerSec) != 2 * boot->BytesPerSec) {
+           || (size_t)write(dosfs, fsinfo, 2 * boot->BytesPerSec)
+           != 2 * boot->BytesPerSec) {
                perr("Unable to write FSInfo");
                free(fsinfo);
                return FSFATAL;



Home | Main Index | Thread Index | Old Index