]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Cleanup: make the indent of cgroup_init()shallower.
authorKen'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Wed, 13 May 2009 04:27:57 +0000 (13:27 +0900)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Mon, 18 May 2009 08:14:40 +0000 (13:44 +0530)
Hi,

This patch makes the indent of cgroup_init() shallower for the readability.

Thanks
Ken'ichi Ohmichi

Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
src/api.c

index 4902c456697e0d79ac39ba9a3fcf71267a0e618f..4f88d202cc9d37331318fe1b0a2fa1eb05156c69 100644 (file)
--- a/src/api.c
+++ b/src/api.c
@@ -633,28 +633,26 @@ int cgroup_init()
        while ((ent = getmntent_r(proc_mount, temp_ent,
                                        mntent_buffer,
                                        sizeof(mntent_buffer))) != NULL) {
-               if (!strcmp(ent->mnt_type, "cgroup")) {
-                       for (i = 0; controllers[i] != NULL; i++) {
-                               mntopt = hasmntopt(ent, controllers[i]);
-
-                               if (!mntopt)
-                                       continue;
-
-                               mntopt = strtok_r(mntopt, ",", &strtok_buffer);
-
-                               if (strcmp(mntopt, controllers[i]) == 0) {
-                                       cgroup_dbg("matched %s:%s\n", mntopt,
-                                               controllers[i]);
-                                       strcpy(cg_mount_table[found_mnt].name,
-                                               controllers[i]);
-                                       strcpy(cg_mount_table[found_mnt].path,
-                                               ent->mnt_dir);
-                                       cgroup_dbg("Found cgroup option %s, "
-                                               " count %d\n",
-                                               ent->mnt_opts, found_mnt);
-                                       found_mnt++;
-                               }
-                       }
+               if (strcmp(ent->mnt_type, "cgroup"))
+                       continue;
+
+               for (i = 0; controllers[i] != NULL; i++) {
+                       mntopt = hasmntopt(ent, controllers[i]);
+
+                       if (!mntopt)
+                               continue;
+
+                       mntopt = strtok_r(mntopt, ",", &strtok_buffer);
+
+                       if (strcmp(mntopt, controllers[i]))
+                               continue;
+
+                       cgroup_dbg("matched %s:%s\n", mntopt, controllers[i]);
+                       strcpy(cg_mount_table[found_mnt].name, controllers[i]);
+                       strcpy(cg_mount_table[found_mnt].path, ent->mnt_dir);
+                       cgroup_dbg("Found cgroup option %s, count %d\n",
+                               ent->mnt_opts, found_mnt);
+                       found_mnt++;
                }
        }