diff options
author | maxim <maxim@FreeBSD.org> | 2004-08-22 08:56:01 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2004-08-22 08:56:01 +0000 |
commit | 42b3943c2d7f8893ba35dba75dfe46a527c5bd58 (patch) | |
tree | 9afa35f8533633f777738965485151633ad5207e /sys | |
parent | c47e28f44c23fdf96eeb1d0715f5727f08173946 (diff) | |
download | FreeBSD-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.c | 2 |
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); |