am 831789a9: am 6ba555f2: Merge "libutils: Don\'t segfault ProcessCallStack when getting thread name fails" into lmp-dev
* commit '831789a9f257bd929caa2fb927c4b902459cce53': libutils: Don't segfault ProcessCallStack when getting thread name fails
This commit is contained in:
commit
613831b958
|
@ -90,6 +90,11 @@ static String8 getThreadName(pid_t tid) {
|
|||
ALOGE("%s: Failed to open %s", __FUNCTION__, path);
|
||||
}
|
||||
|
||||
if (procName == NULL) {
|
||||
// Reading /proc/self/task/%d/comm failed due to a race
|
||||
return String8::format("[err-unknown-tid-%d]", tid);
|
||||
}
|
||||
|
||||
// Strip ending newline
|
||||
strtok(procName, "\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue