From 40addf79d4ecede9526cadf850376a72112b8f57 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 6 May 2020 12:04:09 -0700 Subject: [PATCH] logd: remove unnecessary static ThreadFunction() will only be entered once, so there's no worry that we'll call prctl() multiple times. Test: logging unit tests Change-Id: Id2a02c2ab807f1565e3d625424e040481b3aa1a3 --- logd/LogListener.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp index fbe6ea099..92b384d3c 100644 --- a/logd/LogListener.cpp +++ b/logd/LogListener.cpp @@ -45,11 +45,7 @@ bool LogListener::StartListener() { } void LogListener::ThreadFunction() { - static bool name_set; - if (!name_set) { - prctl(PR_SET_NAME, "logd.writer"); - name_set = true; - } + prctl(PR_SET_NAME, "logd.writer"); while (true) { HandleData();