break;
}
if (ret < 0) {
+ cgroup_warn("Warning: cannot change owner of file %s: %s\n",
+ filename, strerror(errno));
last_errno = errno;
ret = ECGOTHER;
}
fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR |
FTS_NOSTAT, NULL);
if (fts == NULL) {
+ cgroup_warn("Warning: cannot open directory %s: %s\n",
+ path, strerror(errno));
last_errno = errno;
return ECGOTHER;
}
return 0;
fail:
+ cgroup_warn("Warning: cannot change permissions of file %s: %s\n", path,
+ strerror(errno));
last_errno = errno;
return ECGOTHER;
}
fts = fts_open(fts_path, FTS_PHYSICAL | FTS_NOCHDIR |
FTS_NOSTAT, NULL);
if (fts == NULL) {
+ cgroup_warn("Warning: cannot open directory %s: %s\n",
+ fts_path, strerror(errno));
last_errno = errno;
return ECGOTHER;
}
file_mode, filem_change,
owner_is_umask);
if (ret) {
+ cgroup_warn("Warning: cannot change file mode %s: %s\n",
+ fts_path, strerror(errno));
last_errno = errno;
final_ret = ECGOTHER;
}
if (len_procname) {
newrule->procname = strdup(procname);
if (!newrule->procname) {
+ cgroup_err("Error: strdup failed to allocate memory %s\n",
+ strerror(errno));
free(newrule);
last_errno = errno;
ret = ECGOTHER;
proc_cgroup = fopen("/proc/cgroups", "re");
if (!proc_cgroup) {
+ cgroup_err("Error: cannot open /proc/cgroups: %s\n",
+ strerror(errno));
last_errno = errno;
ret = ECGOTHER;
goto unlock_exit;
}
if (!fgets(buf, FILENAME_MAX, proc_cgroup)) {
free(buf);
+ cgroup_err("Error: cannot read /proc/cgroups: %s\n",
+ strerror(errno));
last_errno = errno;
ret = ECGOTHER;
goto unlock_exit;
proc_mount = fopen("/proc/mounts", "re");
if (proc_mount == NULL) {
- ret = ECGFAIL;
+ cgroup_err("Error: cannot open /proc/mounts: %s\n",
+ strerror(errno));
+ last_errno = errno;
+ ret = ECGOTHER;
goto unlock_exit;
}
delete_tasks = fopen(path, "re");
if (delete_tasks) {
ret = cg_move_task_files(delete_tasks, target_tasks);
+ if (ret != 0)
+ cgroup_warn("Warning: removing tasks from %s failed: %s\n",
+ path, cgroup_strerror(ret));
fclose(delete_tasks);
} else {
/*
* removed.
*/
if (errno != ENOENT) {
+ cgroup_err("Error: cannot open %s: %s\n",
+ path, strerror(errno));
last_errno = errno;
ret = ECGOTHER;
}
if ((flags & CGFLAG_DELETE_EMPTY_ONLY) && (errno == EBUSY))
return ECGNONEMPTY;
+ cgroup_warn("Warning: cannot remove directory %s: %s\n",
+ path, strerror(errno));
last_errno = errno;
return ECGOTHER;
}
parent_tasks = fopen(parent_path, "we");
if (!parent_tasks) {
if (first_error == 0) {
+ cgroup_warn("Warning: cannot open tasks file %s: %s\n",
+ parent_path,
+ strerror(errno));
first_errno = errno;
first_error = ECGOTHER;
}
ret = stat(curr->mount.path, &buff);
if (ret < 0 && errno != ENOENT) {
+ cgroup_err("Error: cannot access %s: %s\n",
+ curr->mount.path, strerror(errno));
last_errno = errno;
error = ECGOTHER;
goto out_err;
if (errno == ENOENT) {
ret = cg_mkdir_p(curr->mount.path);
if (ret) {
+ cgroup_err("Error: cannot create directory %s\n",
+ curr->mount.path);
error = ret;
goto out_err;
}
} else if (!S_ISDIR(buff.st_mode)) {
+ cgroup_err("Error: %s already exists but it is not a directory\n",
+ curr->mount.path);
errno = ENOTDIR;
last_errno = errno;
error = ECGOTHER;
CGROUP_FILESYSTEM, 0, curr->name);
if (ret < 0) {
+ cgroup_err("Error: cannot mount %s to %s: %s\n",
+ curr->name, curr->mount.path,
+ strerror(errno));
error = ECGMOUNTFAIL;
goto out_err;
}
while (ret == 0) {
error = umount(path);
if (error) {
+ cgroup_warn("Warning: cannot unmount controller %s on %s: %s\n",
+ mount_info->name, path,
+ strerror(errno));
last_errno = errno;
ret = ECGOTHER;
goto out_error;
if (error) {
/* remember the error and continue unloading
* the rest */
+ cgroup_warn("Warning: cannot clear controller %s\n",
+ info.name);
ret = error;
error = 0;
}