Remove CHECK from GetThreadName.
It's safe for prctl() to fail, so we fall back on <noname> for thread names if we can't get one, instead of crashing. BUG= R=henrika@webrtc.org Review URL: https://webrtc-codereview.appspot.com/57529004 Cr-Commit-Position: refs/heads/master@{#9363}
This commit is contained in:
@@ -111,9 +111,9 @@ static std::string GetThreadId() {
|
||||
|
||||
// Return the current thread's name.
|
||||
static std::string GetThreadName() {
|
||||
char name[17];
|
||||
CHECK_EQ(0, prctl(PR_GET_NAME, name)) << "prctl(PR_GET_NAME) failed";
|
||||
name[16] = '\0';
|
||||
char name[17] = {0};
|
||||
if (prctl(PR_GET_NAME, name) != 0)
|
||||
return std::string("<noname>");
|
||||
return std::string(name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user