windows file fix

This commit is contained in:
Arvid Norberg 2009-02-17 00:00:21 +00:00
parent 5a30111b9b
commit 7b2be278f1
1 changed files with 3 additions and 1 deletions

View File

@ -651,12 +651,14 @@ namespace libtorrent
CloseHandle(ol.hEvent);
return -1;
}
if (GetOverlappedResult(m_file_handle, &ol, &ret, true) == 0)
DWORD tmp;
if (GetOverlappedResult(m_file_handle, &ol, &tmp, true) == 0)
{
ec = error_code(GetLastError(), get_system_category());
CloseHandle(ol.hEvent);
return -1;
}
if (tmp < ret) ret = tmp;
}
CloseHandle(ol.hEvent);