fixed incorrect return codes

This commit is contained in:
Arvid Norberg
2009-01-11 10:21:18 +00:00
parent 27956d4dcb
commit ce6531640b

View File

@@ -541,7 +541,7 @@ namespace libtorrent
if (f == INVALID_HANDLE_VALUE) if (f == INVALID_HANDLE_VALUE)
{ {
ec = error_code(GetLastError(), get_system_category()); ec = error_code(GetLastError(), get_system_category());
return false; return -1;
} }
LARGE_INTEGER offs; LARGE_INTEGER offs;
@@ -556,7 +556,7 @@ namespace libtorrent
{ {
ec = error_code(GetLastError(), get_system_category()); ec = error_code(GetLastError(), get_system_category());
CloseHandle(f); CloseHandle(f);
return false; return -1;
} }
CloseHandle(f); CloseHandle(f);
} }
@@ -604,7 +604,7 @@ namespace libtorrent
if (ftruncate(m_fd, file_offset + size) < 0) if (ftruncate(m_fd, file_offset + size) < 0)
{ {
ec = error_code(errno, get_posix_category()); ec = error_code(errno, get_posix_category());
return false; return -1;
} }
return (std::min)(ret, size_type(size)); return (std::min)(ret, size_type(size));
#endif #endif