diff options
author | Elliott Hughes <enh@google.com> | 2019-04-19 09:19:06 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2019-04-19 09:19:06 -0700 |
commit | bebda8ca8e56aa92b0fc39aa167665e3662c97b1 (patch) | |
tree | 1a98ca78c8048644839febf2b4c4ba12912c9576 /memory_replay | |
parent | e751360ca4335cd79b76dcb546c4e4b9b3cd6706 (diff) | |
download | extras-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.cpp | 2 |
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)); } |