summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}