From 4c1fc3e404d648c70bd2f50ac50aeac6ece8872e Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 6 Jul 2015 19:19:25 -0400 Subject: 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. --- src/vconsole/vconsole-setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vconsole') diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index f7728dcfff..4b21175611 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -56,7 +56,7 @@ static int disable_utf8(int fd) { if (k < 0) r = k; - k = write_string_file("/sys/module/vt/parameters/default_utf8", "0"); + k = write_string_file("/sys/module/vt/parameters/default_utf8", "0", WRITE_STRING_FILE_CREATE); if (k < 0) r = k; @@ -89,7 +89,7 @@ static int enable_utf8(int fd) { if (k < 0) r = k; - k = write_string_file("/sys/module/vt/parameters/default_utf8", "1"); + k = write_string_file("/sys/module/vt/parameters/default_utf8", "1", WRITE_STRING_FILE_CREATE); if (k < 0) r = k; -- cgit v1.2.3-54-g00ecf