Commit Graph

2 Commits

Author SHA1 Message Date
Greg Thelen 799105d514 cgroups: fix cgroup_event_listener error handling
The error handling in cgroup_event_listener.c did not correctly deal
with either an error opening either <control_file> or
cgroup.event_control.  Due to an uninitialized variable the program
exit code was undefined if either of these opens failed.

This patch simplifies and corrects cgroup_event_listener.c error
handling by:
1. using err*() rather than printf(),exit()
2. depending on process exit to close open files

With this patch failures always return non-zero error.

Signed-off-by: Greg Thelen <gthelen@google.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2013-01-08 10:00:44 -08:00
Greg Thelen 92e015b1cf cgroups: move cgroup_event_listener.c to tools/cgroup
Move the cgroup_event_listener.c tool from Documentation into the new
tools/cgroup directory.

This change involves wiring cgroup_event_listener.c into the tools/
make system so that is can be built with:
  $ make tools/cgroup

Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2013-01-07 09:41:28 -08:00