diff --git a/src/win/fs.c b/src/win/fs.c index 41aeffdd..a177a73e 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -1880,8 +1880,9 @@ INLINE static DWORD fs__stat_impl_from_path(WCHAR* path, NULL); if (handle == INVALID_HANDLE_VALUE) - ret = GetLastError(); - else if (fs__stat_handle(handle, statbuf, do_lstat) != 0) + return GetLastError(); + + if (fs__stat_handle(handle, statbuf, do_lstat) != 0) ret = GetLastError(); else ret = 0; @@ -2299,13 +2300,13 @@ INLINE static DWORD fs__utime_impl_from_path(WCHAR* path, flags, NULL); - if (handle == INVALID_HANDLE_VALUE) { + if (handle == INVALID_HANDLE_VALUE) + return GetLastError(); + + if (fs__utime_handle(handle, atime, mtime) != 0) ret = GetLastError(); - } else if (fs__utime_handle(handle, atime, mtime) != 0) { - ret = GetLastError(); - } else { + else ret = 0; - } CloseHandle(handle); return ret;