Add missing error check for thread creation for WIN32
_beginthread() call in empth_create() has two error return values 0L and 1L. Add the missing check for 0L.
This commit is contained in:
parent
af2a87e490
commit
4d7d7bb77e
1 changed files with 1 additions and 1 deletions
|
@ -458,7 +458,7 @@ empth_create(void (*entry)(void *), int size, int flags,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue