From 5ddac5d87d47ace625a04146b91eed6c1ef9daea Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Fri, 18 Apr 2008 05:34:12 +0000 Subject: Miscellaneous scripts and libcg bug fixes Turn off -DDEBUG in Makefile Signed-off-by: Sudhir Kumar Signed-off-by: Balbir Singh git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@18 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'api.c') 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) -- cgit