tree-wide: make use of the new WRITE_STRING_FILE_MKDIR_0755 flag
This commit is contained in:
@@ -490,9 +490,8 @@ static int process_hostname(void) {
|
||||
if (isempty(arg_hostname))
|
||||
return 0;
|
||||
|
||||
mkdir_parents(etc_hostname, 0755);
|
||||
r = write_string_file(etc_hostname, arg_hostname,
|
||||
WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC);
|
||||
WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC | WRITE_STRING_FILE_MKDIR_0755);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to write %s: %m", etc_hostname);
|
||||
|
||||
@@ -512,9 +511,8 @@ static int process_machine_id(void) {
|
||||
if (sd_id128_is_null(arg_machine_id))
|
||||
return 0;
|
||||
|
||||
mkdir_parents(etc_machine_id, 0755);
|
||||
r = write_string_file(etc_machine_id, sd_id128_to_string(arg_machine_id, id),
|
||||
WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC);
|
||||
WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC | WRITE_STRING_FILE_MKDIR_0755);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to write machine id: %m");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user