]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
tools/cgclassify: increase the column width to 100
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 30 Jun 2022 08:26:34 +0000 (13:56 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 11 Jul 2022 19:19:54 +0000 (13:19 -0600)
100 column width is more comfortable to read over 80 columns, lets
increase it.  This patch, also introduced/removes empty lines across
the file, making it more readable.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/cgclassify.c

index 9f19b8301e0dd3c90e52cc2b1bc9d0158914da5c..d3d058fe5b45244b7d6671f633b1041588223eb2 100644 (file)
@@ -29,8 +29,7 @@
 static void usage(int status, const char *program_name)
 {
        if (status != 0) {
-               err("Wrong input parameters, ");
-               err("try %s '-h' for more information.\n", program_name);
+               err("Wrong input parameters, try %s '-h' for more information.\n", program_name);
                return;
        }
 
@@ -39,8 +38,7 @@ static void usage(int status, const char *program_name)
        info("Move running task(s) to given cgroups\n");
        info("  -h, --help                      Display this help\n");
        info("  -g <controllers>:<path> Control group to be used as target\n");
-       info("  --cancel-sticky         cgred daemon change pidlist ");
-       info("and children tasks\n");
+       info("  --cancel-sticky         cgred daemon change pidlist and children tasks\n");
        info("  --sticky                        cgred daemon does not change ");
        info("pidlist and children tasks\n");
 }
@@ -60,8 +58,7 @@ static int change_group_path(pid_t pid, struct cgroup_group_spec *cgroup_list[])
                ret = cgroup_change_cgroup_path(cgroup_list[i]->path, pid,
                                                (const char *const*) cgroup_list[i]->controllers);
                if (ret) {
-                       err("Error changing group of pid %d: %s\n", pid,
-                           cgroup_strerror(ret));
+                       err("Error changing group of pid %d: %s\n", pid, cgroup_strerror(ret));
                        return -1;
                }
        }
@@ -94,8 +91,7 @@ static int change_group_based_on_rule(pid_t pid)
        /* Change the cgroup by determining the rules */
        ret = cgroup_change_cgroup_flags(euid, egid, procname, pid, 0);
        if (ret) {
-               err("Error: change of cgroup failed for pid %d: %s\n", pid,
-                   cgroup_strerror(ret));
+               err("Error: change of cgroup failed for pid %d: %s\n", pid, cgroup_strerror(ret));
                goto out;
        }
        ret = 0;
@@ -137,11 +133,9 @@ int main(int argc, char *argv[])
                        exit(0);
                        break;
                case 'g':
-                       ret = parse_cgroup_spec(cgroup_list, optarg,
-                                               CG_HIER_MAX);
+                       ret = parse_cgroup_spec(cgroup_list, optarg, CG_HIER_MAX);
                        if (ret) {
-                               err("cgroup controller and path parsing ");
-                               err("failed\n");
+                               err("cgroup controller and path parsing failed\n");
                                return -1;
                        }
                        cg_specified = 1;
@@ -162,8 +156,7 @@ int main(int argc, char *argv[])
        /* Initialize libcg */
        ret = cgroup_init();
        if (ret) {
-               err("%s: libcgroup initialization failed: %s\n", argv[0],
-                   cgroup_strerror(ret));
+               err("%s: libcgroup initialization failed: %s\n", argv[0], cgroup_strerror(ret));
                return ret;
        }