summaryrefslogtreecommitdiff
path: root/memory_replay
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-04-19 09:19:06 -0700
committerElliott Hughes <enh@google.com>2019-04-19 09:19:06 -0700
commitbebda8ca8e56aa92b0fc39aa167665e3662c97b1 (patch)
tree1a98ca78c8048644839febf2b4c4ba12912c9576 /memory_replay
parente751360ca4335cd79b76dcb546c4e4b9b3cd6706 (diff)
downloadextras-bebda8ca8e56aa92b0fc39aa167665e3662c97b1.tar.gz
memory_replay: fix pthread_create error checking.
posix_ and pthread_ functions [almost all] return positive errno values on failure. Test: builds Change-Id: Ief1dafdc4fb972f396714ea1ed42183e317c3390
Diffstat (limited to 'memory_replay')
-rw-r--r--memory_replay/Threads.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/memory_replay/Threads.cpp b/memory_replay/Threads.cpp
index 81a679e9..03c5d9cb 100644
--- a/memory_replay/Threads.cpp
+++ b/memory_replay/Threads.cpp
@@ -85,7 +85,7 @@ Thread* Threads::CreateThread(pid_t tid) {
thread->tid_ = tid;
thread->pointers_ = pointers_;
thread->total_time_nsecs_ = 0;
- if (pthread_create(&thread->thread_id_, nullptr, ThreadRunner, thread) == -1) {
+ if ((errno = pthread_create(&thread->thread_id_, nullptr, ThreadRunner, thread)) != 0) {
err(1, "Failed to create thread %d: %s\n", tid, strerror(errno));
}