mirror of https://github.com/BOINC/boinc.git
Increase the number of use cases file_size() works correctly, per JuhaSointusalo.
Juha had a good point in pull-request #1860, capture the bug fix before it gets lost in the sands of time.
This commit is contained in:
parent
9d1972aba6
commit
de26ed5674
|
@ -351,7 +351,7 @@ int boinc_delete_file(const char* path) {
|
|||
//
|
||||
int file_size(const char* path, double& size) {
|
||||
#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
|
||||
HANDLE h = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
|
||||
HANDLE h = CreateFileA(path, 0, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, 0, OPEN_EXISTING, 0, 0);
|
||||
if (h == INVALID_HANDLE_VALUE) return ERR_STAT;
|
||||
LARGE_INTEGER lisize;
|
||||
if (GetFileSizeEx(h, &lisize)) {
|
||||
|
|
Loading…
Reference in New Issue