mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1333384 - nsTemporaryFileInputStream::ReadSegments must consider the stream as closed if PR_Read() return 0, r=bkelly
This commit is contained in:
parent
26f2c60483
commit
5e4160791e
@ -84,6 +84,11 @@ nsTemporaryFileInputStream::ReadSegments(nsWriteSegmentFun writer,
|
||||
while (*result < count) {
|
||||
uint32_t bufCount = std::min(count - *result, (uint32_t) sizeof(buf));
|
||||
int32_t bytesRead = PR_Read(mFileDescOwner->mFD, buf, bufCount);
|
||||
if (bytesRead == 0) {
|
||||
mClosed = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (bytesRead < 0) {
|
||||
return NS_ErrorAccordingToNSPR();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user