From a9952cdd0e8d909219f0463caed11265da028ced Mon Sep 17 00:00:00 2001 From: Tommi Date: Wed, 3 Jun 2015 18:59:11 +0200 Subject: [PATCH] Remove CHECK from GetThreadName. It's safe for prctl() to fail, so we fall back on 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} --- talk/app/webrtc/java/jni/jni_helpers.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/talk/app/webrtc/java/jni/jni_helpers.cc b/talk/app/webrtc/java/jni/jni_helpers.cc index 32d17a1be5..a2cbd61971 100644 --- a/talk/app/webrtc/java/jni/jni_helpers.cc +++ b/talk/app/webrtc/java/jni/jni_helpers.cc @@ -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(""); return std::string(name); }