diff: handle read(2) failures
MFC After: 1 week
This commit is contained in:
@@ -542,6 +542,11 @@ opentemp(const char *f)
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
if (nread == -1) {
|
||||
close(ifd);
|
||||
close(ofd);
|
||||
return (NULL);
|
||||
}
|
||||
close(ifd);
|
||||
lseek(ofd, (off_t)0, SEEK_SET);
|
||||
return (fdopen(ofd, "r"));
|
||||
|
||||
Reference in New Issue
Block a user