]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
cgset: fix misleading error message
authorTom Hromatka <tom.hromatka@oracle.com>
Tue, 15 Jan 2019 23:33:22 +0000 (16:33 -0700)
committerNikola Forró <nforro@redhat.com>
Wed, 16 Jan 2019 12:12:39 +0000 (13:12 +0100)
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.hromatka@oracle.com>
Acked-by: Nikola Forró <nforro@redhat.com>
src/tools/cgset.c

index ea9f90d3eaec478529e8345c6570e56b2463100b..223978656caeba1078646daf416cd455c21fc59b 100644 (file)
@@ -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;
                }