From: Seija Kijin Date: Wed, 1 Feb 2023 22:20:33 +0000 (+0000) Subject: compat/winansi: check for errors of CreateThread() correctly X-Git-Tag: v2.40.0-rc0~28^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=592bcab61b86dbbac6fd2366039b4837b306ed66;p=thirdparty%2Fgit.git compat/winansi: check for errors of CreateThread() correctly The return value for failed thread creation is NULL, not INVALID_HANDLE_VALUE, unlike other Windows API functions. Signed-off-by: Seija Kijin Acked-by: Johannes Sixt Signed-off-by: Junio C Hamano --- diff --git a/compat/winansi.c b/compat/winansi.c index 3abe8dd5a2..f83610f684 100644 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -644,7 +644,7 @@ void winansi_init(void) /* start console spool thread on the pipe's read end */ hthread = CreateThread(NULL, 0, console_thread, NULL, 0, NULL); - if (hthread == INVALID_HANDLE_VALUE) + if (!hthread) die_lasterr("CreateThread(console_thread) failed"); /* schedule cleanup routine */