diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-05-08 13:41:10 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-05-08 13:41:10 -0700 |
commit | e1440d81aef58e8b9983ab1f4540dc1fe5e63ab7 (patch) | |
tree | e4e86c63167a71ae6e76a3bca2dd848768585818 /libcutils | |
parent | a865f6d85a52d0a77d1aef8d5fb5bece08e3b246 (diff) | |
download | system_core-e1440d81aef58e8b9983ab1f4540dc1fe5e63ab7.zip system_core-e1440d81aef58e8b9983ab1f4540dc1fe5e63ab7.tar.gz system_core-e1440d81aef58e8b9983ab1f4540dc1fe5e63ab7.tar.bz2 |
Use O_CLOEXEC when opening cgroup fds.
Bug: 4466013
Change-Id: I0d2e915fc550a0ecaccad5e452dd4c87fc878b8b
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/sched_policy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index 20771c0..3fe83b3 100644 --- a/libcutils/sched_policy.c +++ b/libcutils/sched_policy.c @@ -124,32 +124,32 @@ static void __initialize(void) { #if CAN_SET_SP_SYSTEM filename = "/dev/cpuctl/tasks"; - system_cgroup_fd = open(filename, O_WRONLY); + system_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); if (system_cgroup_fd < 0) { SLOGV("open of %s failed: %s\n", filename, strerror(errno)); } #endif filename = "/dev/cpuctl/foreground/tasks"; - fg_cgroup_fd = open(filename, O_WRONLY); + fg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); if (fg_cgroup_fd < 0) { SLOGE("open of %s failed: %s\n", filename, strerror(errno)); } filename = "/dev/cpuctl/bg_non_interactive/tasks"; - bg_cgroup_fd = open(filename, O_WRONLY); + bg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); if (bg_cgroup_fd < 0) { SLOGE("open of %s failed: %s\n", filename, strerror(errno)); } filename = "/dev/cpuctl/audio_app/tasks"; - audio_app_cgroup_fd = open(filename, O_WRONLY); + audio_app_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); if (audio_app_cgroup_fd < 0) { SLOGV("open of %s failed: %s\n", filename, strerror(errno)); } filename = "/dev/cpuctl/audio_sys/tasks"; - audio_sys_cgroup_fd = open(filename, O_WRONLY); + audio_sys_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); if (audio_sys_cgroup_fd < 0) { SLOGV("open of %s failed: %s\n", filename, strerror(errno)); } |