From c5fe7f83c1feae890523c8d09238ff535caebd58 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Thu, 26 May 2022 08:12:30 -0600 Subject: [PATCH] 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 --- src/api.c | 1 + 1 file changed, 1 insertion(+) 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 }; -- 2.47.2