forked from premiere/premiere-libtorrent
fix missing error handling in windows preadv/pwritev emulation
This commit is contained in:
parent
5ca75a0f0f
commit
4a28e95ce0
24
src/file.cpp
24
src/file.cpp
|
@ -194,11 +194,19 @@ namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForMultipleObjects(num_bufs, h, TRUE, INFINITE);
|
if (WaitForMultipleObjects(num_bufs, h, TRUE, INFINITE) == WAIT_FAILED)
|
||||||
|
{
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < num_bufs; ++i)
|
for (int i = 0; i < num_bufs; ++i)
|
||||||
{
|
{
|
||||||
WaitForSingleObject(ol[i].hEvent, INFINITE);
|
if (WaitForSingleObject(ol[i].hEvent, INFINITE) == WAIT_FAILED)
|
||||||
|
{
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
DWORD num_read;
|
DWORD num_read;
|
||||||
if (GetOverlappedResult(fd, &ol[i], &num_read, FALSE) == FALSE)
|
if (GetOverlappedResult(fd, &ol[i], &num_read, FALSE) == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -256,11 +264,19 @@ done:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitForMultipleObjects(num_bufs, h, TRUE, INFINITE);
|
if (WaitForMultipleObjects(num_bufs, h, TRUE, INFINITE) == WAIT_FAILED)
|
||||||
|
{
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < num_bufs; ++i)
|
for (int i = 0; i < num_bufs; ++i)
|
||||||
{
|
{
|
||||||
WaitForSingleObject(ol[i].hEvent, INFINITE);
|
if (WaitForSingleObject(ol[i].hEvent, INFINITE) == WAIT_FAILED)
|
||||||
|
{
|
||||||
|
ret = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
DWORD num_written;
|
DWORD num_written;
|
||||||
if (GetOverlappedResult(fd, &ol[i], &num_written, FALSE) == FALSE)
|
if (GetOverlappedResult(fd, &ol[i], &num_written, FALSE) == FALSE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue