aboutsummaryrefslogtreecommitdiffstats
path: root/libcutils
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-12-04 04:22:14 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-04 04:22:14 -0800
commitd7dbd7b78ae5c60a6a6071667eaf964b2619fb78 (patch)
tree809a89a8acf74ceb462c7791095be54817bc085b /libcutils
parent092799072fc215b6f95b2d628e670ba2bb14d13b (diff)
parentf95837a1e13c9b63bfe0b0f95f00ec0d72ba2e74 (diff)
downloadsystem_core-d7dbd7b78ae5c60a6a6071667eaf964b2619fb78.tar.gz
system_core-d7dbd7b78ae5c60a6a6071667eaf964b2619fb78.tar.bz2
system_core-d7dbd7b78ae5c60a6a6071667eaf964b2619fb78.zip
am f95837a1: am cf9f442e: am c1c38dd0: system: sched_policy: Don\'t return an error when the thread we\'re trying to move exits on us
Merge commit 'f95837a1e13c9b63bfe0b0f95f00ec0d72ba2e74' * commit 'f95837a1e13c9b63bfe0b0f95f00ec0d72ba2e74': system: sched_policy: Don't return an error when the thread we're trying to move exits on us
Diffstat (limited to 'libcutils')
-rw-r--r--libcutils/sched_policy.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 64d9bb71..8134aa13 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -53,13 +53,22 @@ static int add_tid_to_cgroup(int tid, const char *grp_name)
sprintf(path, "/dev/cpuctl/%s/tasks", grp_name);
if ((fd = open(path, O_WRONLY)) < 0) {
- LOGE("add_tid_to_cgroup failed to open '%s' (%s)\n", path, strerror(errno));
+ LOGE("add_tid_to_cgroup failed to open '%s' (%s)\n", path,
+ strerror(errno));
return -1;
}
sprintf(text, "%d", tid);
if (write(fd, text, strlen(text)) < 0) {
close(fd);
+ /*
+ * If the thread is in the process of exiting,
+ * don't flag an error
+ */
+ if (errno == ESRCH)
+ return 0;
+ LOGW("add_tid_to_cgroup failed to write '%s' (%s)\n", path,
+ strerror(errno));
return -1;
}