Skip to content

Commit 592bcab

Browse files
Seija Kijingitster
authored andcommitted
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 <[email protected]> Acked-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 844ede3 commit 592bcab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compat/winansi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ void winansi_init(void)
644644

645645
/* start console spool thread on the pipe's read end */
646646
hthread = CreateThread(NULL, 0, console_thread, NULL, 0, NULL);
647-
if (hthread == INVALID_HANDLE_VALUE)
647+
if (!hthread)
648648
die_lasterr("CreateThread(console_thread) failed");
649649

650650
/* schedule cleanup routine */

0 commit comments

Comments
 (0)