From: Kamalesh Babulal Date: Thu, 26 May 2022 14:12:30 +0000 (-0600) Subject: api.c: add cgroup error string for ECGNOVERSIONCONVERT X-Git-Tag: v3.0~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5fe7f83c1feae890523c8d09238ff535caebd58;p=thirdparty%2Flibcgroup.git api.c: add cgroup error string for ECGNOVERSIONCONVERT Add the missing error string for the error code ECGNOVERSIONCONVERT to cgroup_strerror_codes[], that is looked upon to print string version of the error encountered. Reproducer: ----------- $ cat cgrp-strerr.c int main(void) { int err = ECGNOVERSIONCONVERT; fprintf(stderr, "%s\n", cgroup_strerror(err)); return 0; } without the patch: ----------------- $ ./cgrp-stderr (null) with the patch: --------------- $ ./cgrp-stderr Failed to convert from cgroup v1 to/from cgroup v2 Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/src/api.c b/src/api.c index 42d3beb5..07d16f57 100644 --- a/src/api.c +++ b/src/api.c @@ -128,6 +128,7 @@ const char * const cgroup_strerror_codes[] = { "This kernel does not support this feature", "Value setting does not succeed", "Failed to remove a non-empty group", + "Failed to convert from cgroup v1 to/from cgroup v2", }; static const char * const cgroup_ignored_tasks_files[] = { "tasks", NULL };