aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-10-29 19:52:46 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-29 19:52:46 -0700
commit525fb03e18f9b08651e3d8abb262d70c3482b405 (patch)
treefbf6cc30417c3375659a3240ffd811a06841666c
parent748cb49e0049e0f504137a4930ec8502affbb03a (diff)
parent58e50f80307577268ecb6b86aa97236e008a9aa0 (diff)
downloadsystem_core-525fb03e18f9b08651e3d8abb262d70c3482b405.tar.gz
system_core-525fb03e18f9b08651e3d8abb262d70c3482b405.tar.bz2
system_core-525fb03e18f9b08651e3d8abb262d70c3482b405.zip
am 58e50f80: am 805d67ab: cutils: sched_policy: Fix bug where we were unable to move backgrounded threads into the foreground
Merge commit '58e50f80307577268ecb6b86aa97236e008a9aa0' into eclair-mr2-plus-aosp * commit '58e50f80307577268ecb6b86aa97236e008a9aa0': cutils: sched_policy: Fix bug where we were unable to move backgrounded threads into the foreground
-rw-r--r--libcutils/sched_policy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 8357bba3..64d9bb71 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -40,7 +40,7 @@
#define SCHED_BATCH 3
#endif
-#define POLICY_DEBUG 1
+#define POLICY_DEBUG 0
static int __sys_supports_schedgroups = -1;
@@ -52,8 +52,10 @@ 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)
+ if ((fd = open(path, O_WRONLY)) < 0) {
+ 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) {
@@ -193,7 +195,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
#endif
if (__sys_supports_schedgroups) {
- const char *grp = NULL;
+ const char *grp = "";
if (policy == SP_BACKGROUND) {
grp = "bg_non_interactive";