diff: handle read(2) failures

MFC After:	1 week
This commit is contained in:
Baptiste Daroussin
2026-03-26 10:25:21 +01:00
parent 33424fd50e
commit 9b98c4b053
+5
View File
@@ -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"));