May 8, 2026
4:30 p.m.
From: Luca Bacci <luca.bacci@outlook.com> --- dlls/msvcrt/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index b1eb86c42c7..3be70b62b61 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1117,7 +1117,10 @@ int CDECL _commit(int fd) TRACE(":fd (%d) handle (%p)\n", fd, info->handle); if (info->handle == INVALID_HANDLE_VALUE) + { + msvcrt_set_errno(ERROR_INVALID_HANDLE); ret = -1; + } else if (!FlushFileBuffers(info->handle)) { if (GetLastError() == ERROR_INVALID_HANDLE) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10846