summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/debugserver')
-rw-r--r--lldb/tools/debugserver/source/DNB.cpp7
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp4
2 files changed, 6 insertions, 5 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;
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index 75ad9f395e5..6adf3de914b 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -815,7 +815,7 @@ best_guess_cpu_type ()
(end of string). */
std::vector<uint8_t>
-decode_binary_data (const char *str, int len)
+decode_binary_data (const char *str, size_t len)
{
std::vector<uint8_t> bytes;
if (len == 0)
@@ -1253,7 +1253,7 @@ RNBRemote::HandlePacket_A (const char *p)
return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Null packet for 'A' pkt");
}
p++;
- if (p == '\0' || !isdigit (*p))
+ if (*p == '\0' || !isdigit (*p))
{
return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "arglen not specified on 'A' pkt");
}
OpenPOWER on IntegriCloud