summaryrefslogtreecommitdiffstats
path: root/libril/ril.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-01-06 12:46:02 -0800
committerElliott Hughes <enh@google.com>2014-01-06 12:46:02 -0800
commitfd81e7146b2e9253aa2ab131d970b9e300f1f97e (patch)
treee1fd86baa02ee930203a8e669c7cab476da41c5c /libril/ril.cpp
parent21538d9410d3d04cc15f08a3a25b5f2501a70f9e (diff)
downloadandroid_hardware_ril-fd81e7146b2e9253aa2ab131d970b9e300f1f97e.tar.gz
android_hardware_ril-fd81e7146b2e9253aa2ab131d970b9e300f1f97e.tar.bz2
android_hardware_ril-fd81e7146b2e9253aa2ab131d970b9e300f1f97e.zip
Fix pthread_create error handling in ril harder.
The previous patch fixed the behavior _if_ something goes wrong... ...but didn't fix the check for whether something went wrong. pthread_create isn't a regular Unix "return -1 and set errno" kind of function; it returns 0 on success and an error number (without setting errno) on failure. Bug: https://code.google.com/p/android/issues/detail?id=64189 Change-Id: I335af890885d6a672d7bac746fdfea3ed3995360
Diffstat (limited to 'libril/ril.cpp')
-rw-r--r--libril/ril.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 0ac698e..03a075f 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -3184,9 +3184,9 @@ RIL_startEventLoop(void) {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- int ret = pthread_create(&s_tid_dispatch, &attr, eventLoop, NULL);
- if (ret < 0) {
- RLOGE("Failed to create dispatch thread: %s", strerror(errno));
+ int result = pthread_create(&s_tid_dispatch, &attr, eventLoop, NULL);
+ if (result != 0) {
+ RLOGE("Failed to create dispatch thread: %s", strerror(result));
goto done;
}