merged file error handling from RC_0_16

This commit is contained in:
Arvid Norberg 2013-02-13 18:03:59 +00:00
parent 6adbd75db8
commit 5133fec4ca
1 changed files with 12 additions and 2 deletions

View File

@ -1344,7 +1344,12 @@ namespace libtorrent
CloseHandle(ol.hEvent);
return -1;
}
WaitForSingleObject(ol.hEvent, INFINITE);
if (WaitForSingleObject(ol.hEvent, INFINITE) == WAIT_FAILED)
{
ec.assign(GetLastError(), get_system_category());
CloseHandle(ol.hEvent);
return -1;
}
DWORD num_read;
if (GetOverlappedResult(m_file_handle, &ol, &num_read, false) == 0)
{
@ -1584,7 +1589,12 @@ namespace libtorrent
CloseHandle(ol.hEvent);
return -1;
}
WaitForSingleObject(ol.hEvent, INFINITE);
if (WaitForSingleObject(ol.hEvent, INFINITE) == WAIT_FAILED)
{
ec.assign(GetLastError(), get_system_category());
CloseHandle(ol.hEvent);
return -1;
}
DWORD num_written;
if (GetOverlappedResult(m_file_handle, &ol, &num_written, false) == 0)
{