Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
libcutils: only change cgroup when fd is initialized [ DO NOT MERGE ]
Browse files Browse the repository at this point in the history
This is to avoid failues on setting non-exist cgroup

Bug: 34193533
Test: on marlin
Change-Id: I619dcba332fda9ec421df811745cf10311beddd3
(cherry picked from commit e46aae2)
  • Loading branch information
weivincewang authored and gitbuildkicker committed Mar 23, 2017
1 parent 73c917f commit e6e89f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcutils/sched_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
}


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;
}
Expand Down

0 comments on commit e6e89f9

Please sign in to comment.