From: Li Zefan <lizefan@huawei.com>
To: Greg Thelen <gthelen@google.com>
Cc: Tejun Heo <tj@kernel.org>,
<containers@lists.linux-foundation.org>,
<cgroups@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] cgroups: fix cgroup_event_listener error handling
Date: Tue, 8 Jan 2013 14:28:44 +0800 [thread overview]
Message-ID: <50EBBC9C.7060909@huawei.com> (raw)
In-Reply-To: <xr93a9sklqme.fsf@gthelen.mtv.corp.google.com>
> 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>
> ---
> tools/cgroup/cgroup_event_listener.c | 72 ++++++++++-----------------------
> 1 files changed, 22 insertions(+), 50 deletions(-)
next prev parent reply other threads:[~2013-01-08 6:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 21:05 [PATCH 1/2] cgroups: move cgroup_event_listener.c to tools/cgroup Greg Thelen
2013-01-04 21:05 ` [PATCH 2/2] cgroups: fix cgroup_event_listener error handling Greg Thelen
2013-01-07 17:44 ` Tejun Heo
2013-01-07 19:50 ` Greg Thelen
2013-01-08 6:28 ` Li Zefan [this message]
2013-01-08 18:08 ` Tejun Heo
2013-01-07 17:42 ` [PATCH 1/2] cgroups: move cgroup_event_listener.c to tools/cgroup Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50EBBC9C.7060909@huawei.com \
--to=lizefan@huawei.com \
--cc=cgroups@vger.kernel.org \
--cc=containers@lists.linux-foundation.org \
--cc=gthelen@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox