Merge "Suppress error log when timerslack_ns write fails for already dead process" am: f5b7361cf4
am: 4976d62a06
Change-Id: Ia6cfb911da99c0984d65dedd48cbf0767a560f91
diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp
index 447852d..b69103c 100644
--- a/libprocessgroup/task_profiles.cpp
+++ b/libprocessgroup/task_profiles.cpp
@@ -90,6 +90,10 @@
if (sys_supports_timerslack) {
auto file = StringPrintf("/proc/%d/timerslack_ns", tid);
if (!WriteStringToFile(std::to_string(slack_), file)) {
+ if (errno == ENOENT) {
+ // This happens when process is already dead
+ return true;
+ }
PLOG(ERROR) << "set_timerslack_ns write failed";
}
}