return rc;
}
-static int create_edit_temp_file(const char *new_path, const char *original_path, char ** const original_unit_paths, char **ret_tmp_fn) {
+static int create_edit_temp_file(
+ const char *new_path,
+ const char *original_path,
+ char ** const original_unit_paths,
+ char **ret_tmp_fn) {
+
_cleanup_free_ char *t = NULL;
int r;
if (!f)
return log_error_errno(errno, "Failed to open \"%s\": %m", t);
- r = fchmod(fileno(f), 0644);
- if (r < 0)
+ if (fchmod(fileno(f), 0644) < 0)
return log_error_errno(errno, "Failed to change mode of \"%s\": %m", t);
r = read_full_file(new_path, &new_contents, NULL);
}
*ret_tmp_fn = TAKE_PTR(t);
-
return 0;
}
run = path_join(paths->runtime_config, name);
if (!run)
return log_oom();
- }
- if (arg_runtime) {
if (access(path, F_OK) >= 0)
return log_error_errno(SYNTHETIC_ERRNO(EEXIST),
"Refusing to create \"%s\" because it would be overridden by \"%s\" anyway.",