Merge "Suppress error log when timerslack_ns write fails for already dead process"

This commit is contained in:
Suren Baghdasaryan 2019-02-14 05:44:34 +00:00 committed by Gerrit Code Review
commit f5b7361cf4
1 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,10 @@ bool SetTimerSlackAction::ExecuteForTask(int tid) const {
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";
}
}