summaryrefslogtreecommitdiffstats
path: root/api.c
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2008-04-18 05:34:12 +0000
committerBalbir Singh <balbir@linux.vnet.ibm.com>2008-04-18 05:34:12 +0000
commit5ddac5d87d47ace625a04146b91eed6c1ef9daea (patch)
tree5078dc82806330bc218b0e412370657c6ea85a73 /api.c
parent0789973a4b487961f70c5eb6c31bb3c1e1589b71 (diff)
downloadlibcg-5ddac5d87d47ace625a04146b91eed6c1ef9daea.tar.gz
libcg-5ddac5d87d47ace625a04146b91eed6c1ef9daea.tar.xz
libcg-5ddac5d87d47ace625a04146b91eed6c1ef9daea.zip
Miscellaneous scripts and libcg bug fixes
Turn off -DDEBUG in Makefile Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@18 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'api.c')
-rw-r--r--api.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/api.c b/api.c
index c2d6ef9..b7a224f 100644
--- a/api.c
+++ b/api.c
@@ -106,6 +106,9 @@ int cg_init()
int ret = 0;
proc_mount = fopen("/proc/mounts", "r");
+ if (proc_mount == NULL) {
+ return EIO;
+ }
while ((ent = getmntent(proc_mount)) != NULL) {
if (!strncmp(ent->mnt_fsname,"cgroup", strlen("cgroup"))) {
@@ -406,14 +409,14 @@ int cg_delete_cgroup(struct cgroup *cgroup, int ignore_migration)
int error = ECGROUPNOTALLOWED;
strcpy(path, MOUNT_POINT);
- strcat(path,"/tasks");
+ strcat(path,"tasks");
base_tasks = fopen(path, "w");
if (!base_tasks)
goto base_open_err;
cg_build_path(cgroup->name, path);
- strcat(path,"/tasks");
+ strcat(path,"tasks");
delete_tasks = fopen(path, "r");
if (!delete_tasks)