summaryrefslogtreecommitdiffstats
path: root/api.c
diff options
context:
space:
mode:
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)