Skip to content

Commit

Permalink
am c1c38dd: system: sched_policy: Don\'t return an error when the thr…
Browse files Browse the repository at this point in the history
…ead we\'re trying to move exits on us

Merge commit 'c1c38dd01c43079ed24b9030bc8a20c649bacc3f' into eclair-mr2

* commit 'c1c38dd01c43079ed24b9030bc8a20c649bacc3f':
  system: sched_policy: Don't return an error when the thread we're trying to move exits on us
  • Loading branch information
San Mehat authored and Android Git Automerger committed Dec 3, 2009
2 parents f837a75 + c1c38dd commit cf9f442
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libcutils/sched_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cf9f442

Please sign in to comment.