fileio: consolidate write_string_file*()

Merge write_string_file(), write_string_file_no_create() and
write_string_file_atomic() into write_string_file() and provide a flags mask
that allows combinations of atomic writing, newline appending and automatic
file creation. Change all users accordingly.
This commit is contained in:
Daniel Mack
2015-07-06 19:19:25 -04:00
parent 40beecdb6d
commit 4c1fc3e404
29 changed files with 106 additions and 101 deletions
+1 -1
View File
@@ -4716,7 +4716,7 @@ int update_reboot_param_file(const char *param) {
if (param) {
r = write_string_file(REBOOT_PARAM_FILE, param);
r = write_string_file(REBOOT_PARAM_FILE, param, WRITE_STRING_FILE_CREATE);
if (r < 0)
log_error("Failed to write reboot param to "
REBOOT_PARAM_FILE": %s", strerror(-r));