diff options
author | San Mehat <san@google.com> | 2009-10-29 13:56:26 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-10-29 13:56:26 -0700 |
commit | 805d67ab11c1bb21d494459d6167f5f67f0002eb (patch) | |
tree | 9ad3e801669d857584193c0343a5d3948a4cd617 /libcutils | |
parent | d2e4e46ce4bc29c3328fccfbbbe0590eaa8713f7 (diff) | |
download | system_core-805d67ab11c1bb21d494459d6167f5f67f0002eb.zip system_core-805d67ab11c1bb21d494459d6167f5f67f0002eb.tar.gz system_core-805d67ab11c1bb21d494459d6167f5f67f0002eb.tar.bz2 |
cutils: sched_policy: Fix bug where we were unable to move backgrounded threads into the foreground
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/sched_policy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index 8357bba..64d9bb7 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"; |