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:
+1
-1
@@ -127,7 +127,7 @@ int main(int argc, char *argv[]) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
r = write_string_file(saved, value);
|
||||
r = write_string_file(saved, value, WRITE_STRING_FILE_CREATE);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to write %s: %m", saved);
|
||||
return EXIT_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user