summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Host/posix/HostThreadPosix.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Host/posix/HostThreadPosix.cpp b/lldb/source/Host/posix/HostThreadPosix.cpp
index 6b1b88bb05d..9c489243193 100644
--- a/lldb/source/Host/posix/HostThreadPosix.cpp
+++ b/lldb/source/Host/posix/HostThreadPosix.cpp
@@ -35,12 +35,15 @@ HostThreadPosix::Join(lldb::thread_result_t *result)
Error error;
if (IsJoinable())
{
- lldb::thread_result_t thread_result;
- int err = ::pthread_join(m_thread, &thread_result);
+ int err = ::pthread_join(m_thread, result);
error.SetError(err, lldb::eErrorTypePOSIX);
}
else
+ {
+ if (result)
+ *result = NULL;
error.SetError(EINVAL, eErrorTypePOSIX);
+ }
Reset();
return error;
OpenPOWER on IntegriCloud