From 4d7d7bb77ed2f2d66e391af45b62d35b8a30c03f Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Thu, 11 Sep 2008 19:14:35 -0600 Subject: [PATCH] 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. --- src/lib/empthread/ntthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index 9b05f7d9..dd57a158 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -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; }