From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Greg Thelen <gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-aSPv4SP+Du0KgorLzL7FmE7CuiCeIGUxQQ4Iyu8u01E@public.gmane.org>
> 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-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Acked-by: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> tools/cgroup/cgroup_event_listener.c | 72 ++++++++++-----------------------
> 1 files changed, 22 insertions(+), 50 deletions(-)
next prev parent reply other threads:[~2013-01-08 6:28 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
[not found] ` <20130107174427.GM3926-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-01-07 19:50 ` Greg Thelen
[not found] ` <xr93a9sklqme.fsf-aSPv4SP+Du0KgorLzL7FmE7CuiCeIGUxQQ4Iyu8u01E@public.gmane.org>
2013-01-08 6:28 ` Li Zefan [this message]
[not found] ` <50EBBC9C.7060909-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
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-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).