@@ -2291,7 +2291,7 @@ static int start_timer_thread(void)
timer_event = CreateEvent(NULL, FALSE, FALSE, NULL);
if (timer_event) {
timer_thread = (HANDLE) _beginthreadex(NULL, 0, ticktack, NULL, 0, NULL);
- if (!timer_thread )
+ if (!timer_thread)
return errno = ENOMEM,
error("cannot start timer thread");
} else
@@ -340,7 +340,7 @@ enum {
TEXT = 0, ESCAPE = 033, BRACKET = '['
};
-static DWORD WINAPI console_thread(LPVOID unused)
+static unsigned int WINAPI console_thread(LPVOID unused)
{
unsigned char buffer[BUFFER_SIZE];
DWORD bytes;
@@ -643,9 +643,9 @@ void winansi_init(void)
die_lasterr("CreateFile for named pipe failed");
/* start console spool thread on the pipe's read end */
- hthread = CreateThread(NULL, 0, console_thread, NULL, 0, NULL);
- if (hthread == INVALID_HANDLE_VALUE)
- die_lasterr("CreateThread(console_thread) failed");
+ hthread = (HANDLE)_beginthreadex(NULL, 0, console_thread, NULL, 0, NULL);
+ if (!hthread)
+ die_lasterr("_beginthreadex(console_thread) failed");
/* schedule cleanup routine */
if (atexit(winansi_exit))