When cgset fails to modify a cgroup, it output a
hardcoded error message which can cause user confusion.
This commit updates the error message to behave like
other error messages throughout libcgroup and produce
a more user-friendly output.

Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com>
---
 src/tools/cgset.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/tools/cgset.c b/src/tools/cgset.c
index ea9f90d..2239786 100644
--- a/src/tools/cgset.c
+++ b/src/tools/cgset.c
@@ -231,9 +231,8 @@ int main(int argc, char *argv[])
                /* modify cgroup based on values of the new one */
                ret = cgroup_modify_cgroup(cgroup);
                if (ret) {
-                       fprintf(stderr, "%s: "
-                               "the group can't be modified\n",
-                               argv[0]);
+                       fprintf(stderr, "%s: cgroup modify error: %s \n",
+                               argv[0], cgroup_strerror(ret));
                        goto cgroup_free_err;
                }
 
-- 
1.8.3.1



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to