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:
parent
9acd9a16f8
commit
598ce966d8
|
@ -736,13 +736,17 @@ eina_file_open(const char *path, Eina_Bool shared)
|
||||||
|
|
||||||
if (handle == INVALID_HANDLE_VALUE)
|
if (handle == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
errno = GetLastError();
|
||||||
WRN("eina_file_open() failed with file %s: %s",
|
WRN("eina_file_open() failed with file %s: %s",
|
||||||
filename, evil_last_error_get());
|
filename, evil_format_message(errno));
|
||||||
goto free_file;
|
goto free_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad))
|
if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad))
|
||||||
goto close_handle;
|
{
|
||||||
|
errno = GetLastError();
|
||||||
|
goto close_handle;
|
||||||
|
}
|
||||||
|
|
||||||
length.u.LowPart = fad.nFileSizeLow;
|
length.u.LowPart = fad.nFileSizeLow;
|
||||||
length.u.HighPart = fad.nFileSizeHigh;
|
length.u.HighPart = fad.nFileSizeHigh;
|
||||||
|
|
Loading…
Reference in New Issue