diff options
author | Renato Botelho <renato@netgate.com> | 2016-02-03 18:01:26 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-02-03 18:01:26 -0200 |
commit | af0758169e63a4e7f6024c241d9254a8bc09908d (patch) | |
tree | a31903fc62c875e8d23a391beb8ae57ed0092c45 /sys/boot/common/misc.c | |
parent | 79f27b5150f7b79a6f1bcd30e9233f1abb9c3e36 (diff) | |
parent | 6114d518f71115abacc5d610c4d668ef6e0b2f37 (diff) | |
download | FreeBSD-src-af0758169e63a4e7f6024c241d9254a8bc09908d.zip FreeBSD-src-af0758169e63a4e7f6024c241d9254a8bc09908d.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/boot/common/misc.c')
-rw-r--r-- | sys/boot/common/misc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/boot/common/misc.c b/sys/boot/common/misc.c index c4c36ea..228dfaf 100644 --- a/sys/boot/common/misc.c +++ b/sys/boot/common/misc.c @@ -118,14 +118,12 @@ kern_bzero(vm_offset_t dest, size_t len) int kern_pread(int fd, vm_offset_t dest, size_t len, off_t off) { - ssize_t nread; if (lseek(fd, off, SEEK_SET) == -1) { printf("\nlseek failed\n"); return (-1); } - nread = archsw.arch_readin(fd, dest, len); - if (nread != len) { + if ((size_t)archsw.arch_readin(fd, dest, len) != len) { printf("\nreadin failed\n"); return (-1); } @@ -140,7 +138,6 @@ void * alloc_pread(int fd, off_t off, size_t len) { void *buf; - ssize_t nread; buf = malloc(len); if (buf == NULL) { @@ -152,8 +149,7 @@ alloc_pread(int fd, off_t off, size_t len) free(buf); return (NULL); } - nread = read(fd, buf, len); - if (nread != len) { + if ((size_t)read(fd, buf, len) != len) { printf("\nread failed\n"); free(buf); return (NULL); |