eina_file: set errno on open fail for win32 build

Summary:
windows does not automatically set errno so we must do it ourselves

@fix
Depends on D8103

Reviewers: vtorri

Reviewed By: vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8104
This commit is contained in:
Mike Blumenkrantz 2019-03-06 08:37:29 -05:00
parent 9acd9a16f8
commit 598ce966d8
1 changed files with 6 additions and 2 deletions

View File

@ -736,13 +736,17 @@ eina_file_open(const char *path, Eina_Bool shared)
if (handle == INVALID_HANDLE_VALUE)
{
errno = GetLastError();
WRN("eina_file_open() failed with file %s: %s",
filename, evil_last_error_get());
filename, evil_format_message(errno));
goto free_file;
}
if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad))
goto close_handle;
{
errno = GetLastError();
goto close_handle;
}
length.u.LowPart = fad.nFileSizeLow;
length.u.HighPart = fad.nFileSizeHigh;