Check a return code from read(2) correctly.
PR: kern/70815 Submitted by: info [at] haakh.de
This commit is contained in:
parent
386c57b571
commit
022c9a28ee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134150
@ -73,7 +73,7 @@ filedup(const char *path, int flags)
|
|||||||
/* Read everything until we know how big it is */
|
/* Read everything until we know how big it is */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
result = read(fd, buf, LOAD_TINYBUF);
|
result = read(fd, buf, LOAD_TINYBUF);
|
||||||
if (size == -1) {
|
if (result == -1) {
|
||||||
free(buf, LOAD_TINYBUF);
|
free(buf, LOAD_TINYBUF);
|
||||||
close(fd);
|
close(fd);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user