Merge pull request #12390 from poettering/string-file-mkdir
fileio: add a WRITE_STRING_FILE_MKDIR_0755 flag to write_string_file() that creates parent directories if needed
This commit is contained in:
@@ -121,10 +121,9 @@ int sync_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) {
|
||||
(void) rm_rf(fn, REMOVE_ROOT|REMOVE_ONLY_DIRECTORIES);
|
||||
|
||||
fn = strjoina(tree, cgroup, "/cgroup.procs");
|
||||
(void) mkdir_parents(fn, 0755);
|
||||
|
||||
sprintf(pid_string, PID_FMT, pid);
|
||||
r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER);
|
||||
r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER|WRITE_STRING_FILE_MKDIR_0755);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to move process: %m");
|
||||
goto finish;
|
||||
|
||||
Reference in New Issue
Block a user