From: Tom Hromatka Date: Tue, 15 Jan 2019 23:33:22 +0000 (-0700) Subject: cgset: fix misleading error message X-Git-Tag: v0.42.rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62f76650db84c0a25f76ece3a79d9d16a1e9f931;p=thirdparty%2Flibcgroup.git cgset: fix misleading error message 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ó --- 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; }