--- lxc_roh/src/lxc/cgroup.c    2011-10-02 19:46:44.000000000 +0200
+++ lxc/src/lxc/cgroup.c        2011-10-02 19:13:44.000000000 +0200
@@ -270,36 +270,36 @@
  */
 int lxc_cgroup_append_task(const char *name, pid_t pid)
 {
-       struct mntent *mntent;
-       FILE *file = NULL;
-       int err = -1;
-       char cgname[MAXPATHLEN];
-
-       file = setmntent(MTAB, "r");
-       if (!file) {
-               SYSERROR("failed to open %s", MTAB);
-               return -1;
-       }
-
-       while ((mntent = getmntent(file))) {
-
-               DEBUG("checking '%s' (%s)", mntent->mnt_dir, mntent->mnt_type);
-
-               if (!strcmp(mntent->mnt_type, "cgroup")) {
-
-                       INFO("found cgroup mounted at '%s'", mntent->mnt_dir);
-                       snprintf(cgname, MAXPATHLEN, "%s/%s", mntent->mnt_dir, 
name);
-                       /* Let's add the pid to the 'tasks' file */
-                       err = cgroup_attach(cgname, pid);
-                       if (err) {
-                               SYSERROR("failed to attach pid '%d' to '%s'", 
pid, cgname);
-                               endmntent(file);
-                               return err;
-                       }
-               }
-       }
-       endmntent(file);
-       return err;
+       struct mntent *mntent;
+       FILE *file = NULL;
+       int err = -1;
+       char cgname[MAXPATHLEN];
+
+       file = setmntent(MTAB, "r");
+       if (!file) {
+               SYSERROR("failed to open %s", MTAB);
+               return -1;
+       }
+
+       while ((mntent = getmntent(file))) {
+
+               DEBUG("checking '%s' (%s)", mntent->mnt_dir, mntent->mnt_type);
+
+               if (!strcmp(mntent->mnt_type, "cgroup")) {
+
+                       INFO("found cgroup mounted at '%s'", mntent->mnt_dir);
+                       snprintf(cgname, MAXPATHLEN, "%s/%s", mntent->mnt_dir, 
name);
+                       /* Let's add the pid to the 'tasks' file */
+                       err = cgroup_attach(cgname, pid);
+                       if (err) {
+                               SYSERROR("failed to attach pid '%d' to '%s'", 
pid, cgname);
+                               endmntent(file);
+                               return err;
+                       }
+               }
+       }
+       endmntent(file);
+       return err;
 }
--- lxc_roh/src/lxc/cgroup.c	2011-10-02 19:46:44.000000000 +0200
+++ lxc/src/lxc/cgroup.c	2011-10-02 19:13:44.000000000 +0200
@@ -270,36 +270,36 @@
  */
 int lxc_cgroup_append_task(const char *name, pid_t pid)
 {
-       struct mntent *mntent;
-       FILE *file = NULL;
-       int err = -1;
-       char cgname[MAXPATHLEN];
-
-       file = setmntent(MTAB, "r");
-       if (!file) {
-               SYSERROR("failed to open %s", MTAB);
-               return -1;
-       }
-
-       while ((mntent = getmntent(file))) {
-
-               DEBUG("checking '%s' (%s)", mntent->mnt_dir, mntent->mnt_type);
-
-               if (!strcmp(mntent->mnt_type, "cgroup")) {
-
-                       INFO("found cgroup mounted at '%s'", mntent->mnt_dir);
-                       snprintf(cgname, MAXPATHLEN, "%s/%s", mntent->mnt_dir, name);
-                       /* Let's add the pid to the 'tasks' file */
-                       err = cgroup_attach(cgname, pid);
-                       if (err) {
-                               SYSERROR("failed to attach pid '%d' to '%s'", pid, cgname);
-                               endmntent(file);
-                               return err;
-                       }
-               }
-       }
-       endmntent(file);
-       return err;
+	struct mntent *mntent;
+	FILE *file = NULL;
+	int err = -1;
+	char cgname[MAXPATHLEN];
+
+	file = setmntent(MTAB, "r");
+	if (!file) {
+		SYSERROR("failed to open %s", MTAB);
+		return -1;
+	}
+
+	while ((mntent = getmntent(file))) {
+
+		DEBUG("checking '%s' (%s)", mntent->mnt_dir, mntent->mnt_type);
+
+		if (!strcmp(mntent->mnt_type, "cgroup")) {
+
+			INFO("found cgroup mounted at '%s'", mntent->mnt_dir);
+			snprintf(cgname, MAXPATHLEN, "%s/%s", mntent->mnt_dir, name);
+			/* Let's add the pid to the 'tasks' file */
+			err = cgroup_attach(cgname, pid);
+			if (err) {
+				SYSERROR("failed to attach pid '%d' to '%s'", pid, cgname);
+				endmntent(file);
+				return err;
+			}
+		}
+	}
+	endmntent(file);
+	return err;
 }
 
 
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to