_beginthread() call in empth_create() has two error
return values 0L and 1L. Add the missing check for 0L.
size = loc_MIN_THREAD_STACK;
pThread->ulThreadID = _beginthread(empth_threadMain, size, pThread);
size = loc_MIN_THREAD_STACK;
pThread->ulThreadID = _beginthread(empth_threadMain, size, pThread);
- if (pThread->ulThreadID == 1L) {
+ if (pThread->ulThreadID == 1L || pThread->ulThreadID == 0L) {
logerror("can not create thread: %s: %s", name, strerror(errno));
goto bad;
}
logerror("can not create thread: %s: %s", name, strerror(errno));
goto bad;
}