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 <doremylover123@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Seija Kijin committed Feb 1, 2023 at 22:20 UTC 592bcab61b86dbbac6fd2366039b4837b306ed66
1 file changed +1 -1
compat/winansi.c
+1 -1
@@ -644,7 +644,7 @@ void winansi_init(void)
644
645 /* start console spool thread on the pipe's read end */
646 hthread = CreateThread(NULL, 0, console_thread, NULL, 0, NULL);
647 - if (hthread == INVALID_HANDLE_VALUE)
647 + if (!hthread)
648 die_lasterr("CreateThread(console_thread) failed");
649
650 /* schedule cleanup routine */