This patch add one return value check for lssubsys

Signed-off-by: Ivana Hutarova Varekova <[email protected]>
---

 src/tools/lssubsys.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/tools/lssubsys.c b/src/tools/lssubsys.c
index 306d4e0..89d0229 100644
--- a/src/tools/lssubsys.c
+++ b/src/tools/lssubsys.c
@@ -60,6 +60,11 @@ static int print_controller(cont_name_t cont_name, int flags)
        int output = 0;
 
        ret = cgroup_get_controller_begin(&handle, &controller);
+       if (ret != 0) {
+               fprintf(stderr, "cannot read controller data: %s\n",
+                       cgroup_strerror(ret));
+               return ret;
+       }
 
        path[0] = '\0';
        name[0] = '\0';


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to