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 89d0229..e48daa6 100644
--- a/src/tools/lssubsys.c
+++ b/src/tools/lssubsys.c
@@ -195,6 +195,11 @@ static int print_all_controllers_in_hierarchy(const char 
*tname,
        }
 
        ret = cgroup_get_all_controller_begin(&handle, &info);
+       if ((ret != 0) && (ret != ECGEOF)) {
+               fprintf(stderr, "cannot read controller data: %s\n",
+                       cgroup_strerror(ret));
+               return ret;
+       }
 
        while (ret != ECGEOF) {
                /* controller is in the hierrachy */


------------------------------------------------------------------------------
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