add test for empty controller/variable stack

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

 doc/man/cgget.1   |    2 ++
 src/tools/cgget.c |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/doc/man/cgget.1 b/doc/man/cgget.1
index f02fbba..543f7f2 100644
--- a/doc/man/cgget.1
+++ b/doc/man/cgget.1
@@ -12,6 +12,8 @@ cgget \- print parameter(s) of given group(s)
 
 .SH DESCRIPTION
 The command prints the parameter(s) of input cgroup(s).
+If there is not set any controller or variable,
+then values of all possible variables are displayed.
 
 .TP
 .B <path>
diff --git a/src/tools/cgget.c b/src/tools/cgget.c
index de1a7dc..433e3b6 100644
--- a/src/tools/cgget.c
+++ b/src/tools/cgget.c
@@ -321,6 +321,13 @@ int main(int argc, char *argv[])
                goto err;
        }
 
+       /*
+        * if no controller or variable is set
+        * then show values of all possible variables
+        */
+       if ((c_number == 0) && (n_number == 0))
+               mode |=  MODE_SHOW_ALL_CONTROLLERS;
+
        /* Initialize libcgroup. */
        ret = cgroup_init();
        if (ret) {


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to