summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/DNB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/debugserver/source/DNB.cpp')
-rw-r--r--lldb/tools/debugserver/source/DNB.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp
index d7955541f14..dd54c6a7b09 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -165,9 +165,10 @@ waitpid_thread (void *arg)
static bool
spawn_waitpid_thread (pid_t pid)
{
- pthread_t thread = THREAD_NULL;
- ::pthread_create (&thread, NULL, waitpid_thread, (void *)(intptr_t)pid);
- if (thread != THREAD_NULL)
+ pthread_t thread;
+ int ret = ::pthread_create (&thread, NULL, waitpid_thread, (void *)(intptr_t)pid);
+ // pthread_create returns 0 if successful
+ if (ret == 0)
{
::pthread_detach (thread);
return true;
OpenPOWER on IntegriCloud