[PATCH 0/1] MR10846: msvcrt: Set errno in failure path
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
Piotr Caban (@piotr) commented about dlls/msvcrt/file.c:
TRACE(":fd (%d) handle (%p)\n", fd, info->handle);
if (info->handle == INVALID_HANDLE_VALUE) + { + msvcrt_set_errno(ERROR_INVALID_HANDLE);
Native is not setting \_doserrno in this case. Could you please change it to: ```suggestion:-0+0 *_errno() = EBADF; ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10846#note_139364
participants (3)
-
Luca Bacci -
Luca Bacci (@lb90) -
Piotr Caban (@piotr)