From 62f76650db84c0a25f76ece3a79d9d16a1e9f931 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Tue, 15 Jan 2019 16:33:22 -0700 Subject: [PATCH] cgset: fix misleading error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Acked-by: Nikola Forró --- 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 ea9f90d3..22397865 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; } -- 2.47.2