diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-04-18 05:34:12 +0000 |
---|---|---|
committer | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-04-18 05:34:12 +0000 |
commit | 5ddac5d87d47ace625a04146b91eed6c1ef9daea (patch) | |
tree | 5078dc82806330bc218b0e412370657c6ea85a73 /api.c | |
parent | 0789973a4b487961f70c5eb6c31bb3c1e1589b71 (diff) | |
download | libcg-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |