libcutils: only change cgroup when fd is initialized
This is to avoid failues on setting non-exist cgroup Bug: 34193533 Test: on marlin Change-Id: I619dcba332fda9ec421df811745cf10311beddd3
This commit is contained in:
parent
a27a91a5fd
commit
97957fc420
1 changed files with 1 additions and 1 deletions
|
@ -464,7 +464,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
|
|||
break;
|
||||
}
|
||||
|
||||
if (add_tid_to_cgroup(tid, fd) != 0) {
|
||||
if (fd > 0 && add_tid_to_cgroup(tid, fd) != 0) {
|
||||
if (errno != ESRCH && errno != ENOENT)
|
||||
return -errno;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue