merged file error handling from RC_0_16
This commit is contained in:
parent
6adbd75db8
commit
5133fec4ca
14
src/file.cpp
14
src/file.cpp
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue