*lastslash = oldv;
free(fpath);
fpath = must_make_path(path, "cpuset.cpus", NULL);
- ret = lxc_write_to_file(fpath, cpulist, strlen(cpulist), false);
+ ret = lxc_write_to_file(fpath, cpulist, strlen(cpulist), false, 0666);
if (ret < 0) {
SYSERROR("Failed to write cpu list to \"%s\"", fpath);
goto on_error;
*lastslash = oldv;
fpath = must_make_path(path, file, NULL);
- ret = lxc_write_to_file(fpath, value, len, false);
+ ret = lxc_write_to_file(fpath, value, len, false, 0666);
if (ret < 0)
SYSERROR("Failed to write \"%s\" to file \"%s\"", value, fpath);
free(fpath);
}
free(cgpath);
- ret = lxc_write_to_file(clonechildrenpath, "1", 1, false);
+ ret = lxc_write_to_file(clonechildrenpath, "1", 1, false, 0666);
if (ret < 0) {
/* Set clone_children so children inherit our settings */
SYSERROR("Failed to write 1 to \"%s\"", clonechildrenpath);
cgroup = must_append_path(cgroup, parts[i], NULL);
target = must_make_path(cgroup, "cgroup.subtree_control", NULL);
- ret = lxc_write_to_file(target, add_controllers, full_len, false);
+ ret = lxc_write_to_file(target, add_controllers, full_len, false, 0666);
free(target);
if (ret < 0) {
SYSERROR("Could not enable \"%s\" controllers in the "
fullpath = must_make_path(hierarchies[i]->fullcgpath,
"cgroup.procs", NULL);
- ret = lxc_write_to_file(fullpath, pidstr, len, false);
+ ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666);
if (ret != 0) {
SYSERROR("Failed to enter cgroup \"%s\"", fullpath);
free(fullpath);
fullpath = must_make_path(hierarchies[i]->mountpoint,
hierarchies[i]->base_cgroup,
"cgroup.procs", NULL);
- ret = lxc_write_to_file(fullpath, "0", 2, false);
+ ret = lxc_write_to_file(fullpath, "0", 2, false, 0666);
if (ret != 0) {
SYSERROR("Failed to escape to cgroup \"%s\"", fullpath);
free(fullpath);
return false;
fullpath = must_make_path(h->fullcgpath, "freezer.state", NULL);
- ret = lxc_write_to_file(fullpath, THAWED, THAWED_LEN, false);
+ ret = lxc_write_to_file(fullpath, THAWED, THAWED_LEN, false, 0666);
free(fullpath);
if (ret < 0)
return false;
base_path = must_make_path(h->mountpoint, container_cgroup, NULL);
full_path = must_make_path(base_path, "cgroup.procs", NULL);
/* cgroup is populated */
- ret = lxc_write_to_file(full_path, pidstr, pidstr_len, false);
+ ret = lxc_write_to_file(full_path, pidstr, pidstr_len, false, 0666);
if (ret < 0 && errno != EBUSY)
goto on_error;
goto on_error;
strcat(full_path, "/cgroup.procs");
- ret = lxc_write_to_file(full_path, pidstr, len, false);
+ ret = lxc_write_to_file(full_path, pidstr, len, false, 0666);
if (ret == 0)
goto on_success;
fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs");
free(path);
- ret = lxc_write_to_file(fullpath, pidstr, len, false);
+ ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666);
if (ret < 0) {
SYSERROR("Failed to attach %d to %s", (int)pid, fullpath);
free(fullpath);
char *fullpath;
fullpath = build_full_cgpath_from_monitorpath(h, path, filename);
- ret = lxc_write_to_file(fullpath, value, strlen(value), false);
+ ret = lxc_write_to_file(fullpath, value, strlen(value), false, 0666);
free(fullpath);
}
free(path);
}
fullpath = must_make_path(h->fullcgpath, filename, NULL);
- ret = lxc_write_to_file(fullpath, value, strlen(value), false);
+ ret = lxc_write_to_file(fullpath, value, strlen(value), false, 0666);
free(fullpath);
return ret;
}
struct lxc_cgroup *cg = iterator->elem;
fullpath = must_make_path(h->fullcgpath, cg->subsystem, NULL);
- ret = lxc_write_to_file(fullpath, cg->value, strlen(cg->value), false);
+ ret = lxc_write_to_file(fullpath, cg->value, strlen(cg->value), false, 0666);
free(fullpath);
if (ret < 0) {
SYSERROR("Failed to set \"%s\" to \"%s\"",