summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2004-08-22 08:56:01 +0000
committermaxim <maxim@FreeBSD.org>2004-08-22 08:56:01 +0000
commit42b3943c2d7f8893ba35dba75dfe46a527c5bd58 (patch)
tree9afa35f8533633f777738965485151633ad5207e /sys
parentc47e28f44c23fdf96eeb1d0715f5727f08173946 (diff)
downloadFreeBSD-src-42b3943c2d7f8893ba35dba75dfe46a527c5bd58.zip
FreeBSD-src-42b3943c2d7f8893ba35dba75dfe46a527c5bd58.tar.gz
Check a return code from read(2) correctly.
PR: kern/70815 Submitted by: info [at] haakh.de
Diffstat (limited to 'sys')
-rw-r--r--sys/boot/common/load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/boot/common/load.c b/sys/boot/common/load.c
index e00487d..7470f96 100644
--- a/sys/boot/common/load.c
+++ b/sys/boot/common/load.c
@@ -73,7 +73,7 @@ filedup(const char *path, int flags)
/* Read everything until we know how big it is */
for (;;) {
result = read(fd, buf, LOAD_TINYBUF);
- if (size == -1) {
+ if (result == -1) {
free(buf, LOAD_TINYBUF);
close(fd);
return(NULL);
OpenPOWER on IntegriCloud