summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2017-03-20 15:13:05 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-04-21 20:38:30 +0000
commit6617398c25c98ee5aa5e880efd62eef8a814c932 (patch)
tree38c8fff2c30de9871e0f793074df1874d990e915
parenta8d5351650906abbc5b56cd1158e22d07592e1eb (diff)
libcutils: only change cgroup when fd is initialized [ DO NOT MERGE ]
Change-Id: I2ff42dc2d722b399d3a03bd855eff0328ed8d47d
-rw-r--r--libcutils/sched_policy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 05a20481d..6d905898a 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -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;
}