diff options
author | Elliott Hughes <enh@google.com> | 2015-06-30 08:22:24 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-06-30 10:41:15 -0700 |
commit | 6ed68cc412752e4c78755df9a1516e610ec66fa8 (patch) | |
tree | 287929b99130bf3a06b67b5abf2d3b4b6d8199f3 /libutils/Threads.cpp | |
parent | 692dc75d9fbf5c256cd8c66219a930ae0fe9f523 (diff) | |
download | system_core-6ed68cc412752e4c78755df9a1516e610ec66fa8.tar.gz system_core-6ed68cc412752e4c78755df9a1516e610ec66fa8.tar.bz2 system_core-6ed68cc412752e4c78755df9a1516e610ec66fa8.zip |
Consistently use strerror in libutils.
It's easier for people to debug, and side-steps the problem that errno
values differ between architectures.
Bug: http://b/17458391
Change-Id: I1db9b2cbb653839d3936b91e37e5cff02671318a
Diffstat (limited to 'libutils/Threads.cpp')
-rw-r--r-- | libutils/Threads.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp index 1e014c64e..c3666e4b4 100644 --- a/libutils/Threads.cpp +++ b/libutils/Threads.cpp @@ -22,6 +22,7 @@ #include <memory.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <unistd.h> #if !defined(_WIN32) @@ -160,9 +161,9 @@ int androidCreateRawThreadEtc(android_thread_func_t entryFunction, (android_pthread_entry)entryFunction, userData); pthread_attr_destroy(&attr); if (result != 0) { - ALOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, errno=%d)\n" + ALOGE("androidCreateRawThreadEtc failed (entry=%p, res=%d, %s)\n" "(android threadPriority=%d)", - entryFunction, result, errno, threadPriority); + entryFunction, result, strerror(errno), threadPriority); return 0; } |