blob: bd627c51e9530d11784ec24a087a149cc9916b02 [file] [log] [blame]
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001From 7cb6579572b50ef44bc0a321a4c73cce55b0c2f2 Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 1 Mar 2019 15:22:15 +0800
William A. Kennington IIIac69b482021-06-02 12:28:27 -07004Subject: [PATCH] do not disable buffer in writing files
Brad Bishop19323692019-04-05 15:28:33 -04005
6Do not disable buffer in writing files, otherwise we get
7failure at boot for musl like below.
8
9 [!!!!!!] Failed to allocate manager object.
10
11And there will be other failures, critical or not critical.
12This is specific to musl.
13
14Upstream-Status: Inappropriate [musl]
15
16Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Brad Bishopc342db32019-05-15 21:57:59 -040017[Rebased for v242]
18Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Brad Bishopa34c0302019-09-23 22:34:48 -040019[rebased for systemd 243]
20Signed-off-by: Scott Murray <scott.murray@konsulko.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070021
Brad Bishop19323692019-04-05 15:28:33 -040022---
Andrew Geissler82c905d2020-04-13 13:39:40 -050023 src/basic/cgroup-util.c | 10 +++++-----
Brad Bishop19323692019-04-05 15:28:33 -040024 src/basic/procfs-util.c | 4 ++--
25 src/basic/smack-util.c | 2 +-
William A. Kennington IIIac69b482021-06-02 12:28:27 -070026 src/basic/sysctl-util.c | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040027 src/basic/util.c | 2 +-
28 src/binfmt/binfmt.c | 6 +++---
29 src/core/main.c | 4 ++--
30 src/core/smack-setup.c | 8 ++++----
31 src/hibernate-resume/hibernate-resume.c | 2 +-
32 src/libsystemd/sd-device/sd-device.c | 2 +-
33 src/login/logind-dbus.c | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040034 src/nspawn/nspawn-cgroup.c | 2 +-
35 src/nspawn/nspawn.c | 6 +++---
Andrew Geissler82c905d2020-04-13 13:39:40 -050036 src/shared/cgroup-setup.c | 4 ++--
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 src/sleep/sleep.c | 8 ++++----
Brad Bishop19323692019-04-05 15:28:33 -040038 src/vconsole/vconsole-setup.c | 2 +-
William A. Kennington IIIac69b482021-06-02 12:28:27 -070039 16 files changed, 33 insertions(+), 33 deletions(-)
Brad Bishop19323692019-04-05 15:28:33 -040040
Andrew Geisslerd1e89492021-02-12 15:35:20 -060041diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070042index 50c1ae1b2b..5b40e92163 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -060043--- a/src/basic/cgroup-util.c
44+++ b/src/basic/cgroup-util.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070045@@ -765,7 +765,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
Brad Bishop19323692019-04-05 15:28:33 -040046
47 sc = strstrip(contents);
48 if (isempty(sc)) {
49- r = write_string_file(fs, agent, WRITE_STRING_FILE_DISABLE_BUFFER);
50+ r = write_string_file(fs, agent, 0);
51 if (r < 0)
52 return r;
53 } else if (!path_equal(sc, agent))
William A. Kennington IIIac69b482021-06-02 12:28:27 -070054@@ -783,7 +783,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
Brad Bishop19323692019-04-05 15:28:33 -040055
56 sc = strstrip(contents);
57 if (streq(sc, "0")) {
58- r = write_string_file(fs, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
59+ r = write_string_file(fs, "1", 0);
60 if (r < 0)
61 return r;
62
William A. Kennington IIIac69b482021-06-02 12:28:27 -070063@@ -810,7 +810,7 @@ int cg_uninstall_release_agent(const char *controller) {
Brad Bishop19323692019-04-05 15:28:33 -040064 if (r < 0)
65 return r;
66
67- r = write_string_file(fs, "0", WRITE_STRING_FILE_DISABLE_BUFFER);
68+ r = write_string_file(fs, "0", 0);
69 if (r < 0)
70 return r;
71
William A. Kennington IIIac69b482021-06-02 12:28:27 -070072@@ -820,7 +820,7 @@ int cg_uninstall_release_agent(const char *controller) {
Brad Bishop19323692019-04-05 15:28:33 -040073 if (r < 0)
74 return r;
75
76- r = write_string_file(fs, "", WRITE_STRING_FILE_DISABLE_BUFFER);
77+ r = write_string_file(fs, "", 0);
78 if (r < 0)
79 return r;
80
William A. Kennington IIIac69b482021-06-02 12:28:27 -070081@@ -1650,7 +1650,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri
Brad Bishop19323692019-04-05 15:28:33 -040082 if (r < 0)
83 return r;
84
85- return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
86+ return write_string_file(p, value, 0);
87 }
88
89 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
Andrew Geisslerd1e89492021-02-12 15:35:20 -060090diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
91index 8f9eee8d36..480f8cc0b4 100644
92--- a/src/basic/procfs-util.c
93+++ b/src/basic/procfs-util.c
94@@ -86,13 +86,13 @@ int procfs_tasks_set_limit(uint64_t limit) {
Brad Bishop19323692019-04-05 15:28:33 -040095 * decrease it, as threads-max is the much more relevant sysctl. */
96 if (limit > pid_max-1) {
97 sprintf(buffer, "%" PRIu64, limit+1); /* Add one, since PID 0 is not a valid PID */
98- r = write_string_file("/proc/sys/kernel/pid_max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
99+ r = write_string_file("/proc/sys/kernel/pid_max", buffer, 0);
100 if (r < 0)
101 return r;
102 }
103
104 sprintf(buffer, "%" PRIu64, limit);
105- r = write_string_file("/proc/sys/kernel/threads-max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
106+ r = write_string_file("/proc/sys/kernel/threads-max", buffer, 0);
107 if (r < 0) {
108 uint64_t threads_max;
109
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600110diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c
111index 3362ee3924..80c0f2a52e 100644
112--- a/src/basic/smack-util.c
113+++ b/src/basic/smack-util.c
114@@ -114,7 +114,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
Brad Bishop19323692019-04-05 15:28:33 -0400115 return 0;
116
117 p = procfs_file_alloca(pid, "attr/current");
118- r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER);
119+ r = write_string_file(p, label, 0);
120 if (r < 0)
121 return r;
122
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700123diff --git a/src/basic/sysctl-util.c b/src/basic/sysctl-util.c
124index c96b5cd77f..d2476d9665 100644
125--- a/src/basic/sysctl-util.c
126+++ b/src/basic/sysctl-util.c
127@@ -93,7 +93,7 @@ int sysctl_write_ip_property(int af, const char *ifname, const char *property, c
128
129 log_debug("Setting '%s' to '%s'", p, value);
130
131- return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
132+ return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
133 }
134
135 int sysctl_read(const char *property, char **ret) {
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600136diff --git a/src/basic/util.c b/src/basic/util.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700137index 955b18bd2a..6d89c90176 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600138--- a/src/basic/util.c
139+++ b/src/basic/util.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700140@@ -234,7 +234,7 @@ void disable_coredumps(void) {
Brad Bishop19323692019-04-05 15:28:33 -0400141 if (detect_container() > 0)
142 return;
143
144- r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
145+ r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
146 if (r < 0)
147 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
148 }
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600149diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700150index f6b72e0bae..e9fd4d06be 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600151--- a/src/binfmt/binfmt.c
152+++ b/src/binfmt/binfmt.c
153@@ -48,7 +48,7 @@ static int delete_rule(const char *rule) {
Brad Bishop19323692019-04-05 15:28:33 -0400154 if (!fn)
155 return log_oom();
156
157- return write_string_file(fn, "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
158+ return write_string_file(fn, "-1", 0);
159 }
160
161 static int apply_rule(const char *rule) {
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600162@@ -56,7 +56,7 @@ static int apply_rule(const char *rule) {
Brad Bishop19323692019-04-05 15:28:33 -0400163
164 (void) delete_rule(rule);
165
166- r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, WRITE_STRING_FILE_DISABLE_BUFFER);
167+ r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, 0);
168 if (r < 0)
169 return log_error_errno(r, "Failed to add binary format: %m");
170
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700171@@ -222,7 +222,7 @@ static int run(int argc, char *argv[]) {
Brad Bishop19323692019-04-05 15:28:33 -0400172 }
173
174 /* Flush out all rules */
Brad Bishopa34c0302019-09-23 22:34:48 -0400175- (void) write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
176+ (void) write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
Brad Bishop19323692019-04-05 15:28:33 -0400177
178 STRV_FOREACH(f, files) {
179 k = apply_file(*f, true);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600180diff --git a/src/core/main.c b/src/core/main.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700181index 3ee8d0a869..ec36e3e80f 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600182--- a/src/core/main.c
183+++ b/src/core/main.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700184@@ -1401,7 +1401,7 @@ static int bump_unix_max_dgram_qlen(void) {
Brad Bishop19323692019-04-05 15:28:33 -0400185 if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN)
186 return 0;
187
188- r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", WRITE_STRING_FILE_DISABLE_BUFFER, "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
189+ r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", 0, "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
190 if (r < 0)
191 return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r,
192 "Failed to bump AF_UNIX datagram queue length, ignoring: %m");
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700193@@ -1678,7 +1678,7 @@ static void initialize_core_pattern(bool skip_setup) {
Brad Bishop19323692019-04-05 15:28:33 -0400194 if (getpid_cached() != 1)
195 return;
196
197- r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, WRITE_STRING_FILE_DISABLE_BUFFER);
198+ r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, 0);
199 if (r < 0)
200 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m", arg_early_core_pattern);
201 }
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600202diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700203index 8cc1696a4f..ab7b4ba2c3 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600204--- a/src/core/smack-setup.c
205+++ b/src/core/smack-setup.c
206@@ -325,17 +325,17 @@ int mac_smack_setup(bool *loaded_policy) {
Brad Bishop19323692019-04-05 15:28:33 -0400207 }
208
209 #ifdef SMACK_RUN_LABEL
210- r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
211+ r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0);
212 if (r < 0)
213 log_warning_errno(r, "Failed to set SMACK label \"" SMACK_RUN_LABEL "\" on self: %m");
214- r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
215+ r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, 0);
216 if (r < 0)
217 log_warning_errno(r, "Failed to set SMACK ambient label \"" SMACK_RUN_LABEL "\": %m");
218 r = write_string_file("/sys/fs/smackfs/netlabel",
219- "0.0.0.0/0 " SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
220+ "0.0.0.0/0 " SMACK_RUN_LABEL, 0);
221 if (r < 0)
222 log_warning_errno(r, "Failed to set SMACK netlabel rule \"0.0.0.0/0 " SMACK_RUN_LABEL "\": %m");
223- r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", WRITE_STRING_FILE_DISABLE_BUFFER);
224+ r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", 0);
225 if (r < 0)
226 log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m");
227 #endif
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600228diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700229index 58e35e403e..1d0beb4008 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600230--- a/src/hibernate-resume/hibernate-resume.c
231+++ b/src/hibernate-resume/hibernate-resume.c
Brad Bishop19323692019-04-05 15:28:33 -0400232@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
233 return EXIT_FAILURE;
234 }
235
236- r = write_string_file("/sys/power/resume", major_minor, WRITE_STRING_FILE_DISABLE_BUFFER);
237+ r = write_string_file("/sys/power/resume", major_minor, 0);
238 if (r < 0) {
239 log_error_errno(r, "Failed to write '%s' to /sys/power/resume: %m", major_minor);
240 return EXIT_FAILURE;
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600241diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700242index d82f01a164..b8fd63346c 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600243--- a/src/libsystemd/sd-device/sd-device.c
244+++ b/src/libsystemd/sd-device/sd-device.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700245@@ -1987,7 +1987,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr,
Brad Bishop19323692019-04-05 15:28:33 -0400246 if (!value)
247 return -ENOMEM;
248
249- r = write_string_file(path, value, WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_NOFOLLOW);
250+ r = write_string_file(path, value, 0 | WRITE_STRING_FILE_NOFOLLOW);
251 if (r < 0) {
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700252 /* On failure, clear cache entry, as we do not know how it fails. */
253 device_remove_cached_sysattr_value(device, sysattr);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600254diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700255index 3bc424b83b..5f5eef0843 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600256--- a/src/login/logind-dbus.c
257+++ b/src/login/logind-dbus.c
258@@ -1330,7 +1330,7 @@ static int trigger_device(Manager *m, sd_device *d) {
Brad Bishop19323692019-04-05 15:28:33 -0400259 if (!t)
260 return -ENOMEM;
261
262- (void) write_string_file(t, "change", WRITE_STRING_FILE_DISABLE_BUFFER);
263+ (void) write_string_file(t, "change", 0);
264 }
265
266 return 0;
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600267diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c
268index cb01b25bc6..e92051268b 100644
269--- a/src/nspawn/nspawn-cgroup.c
270+++ b/src/nspawn/nspawn-cgroup.c
271@@ -124,7 +124,7 @@ int sync_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) {
Brad Bishopa34c0302019-09-23 22:34:48 -0400272 fn = strjoina(tree, cgroup, "/cgroup.procs");
Brad Bishop19323692019-04-05 15:28:33 -0400273
274 sprintf(pid_string, PID_FMT, pid);
Brad Bishopa34c0302019-09-23 22:34:48 -0400275- r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER|WRITE_STRING_FILE_MKDIR_0755);
276+ r = write_string_file(fn, pid_string, WRITE_STRING_FILE_MKDIR_0755);
Brad Bishop19323692019-04-05 15:28:33 -0400277 if (r < 0) {
278 log_error_errno(r, "Failed to move process: %m");
279 goto finish;
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600280diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700281index 0c41a48d4b..9c893b18e4 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600282--- a/src/nspawn/nspawn.c
283+++ b/src/nspawn/nspawn.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700284@@ -2695,7 +2695,7 @@ static int reset_audit_loginuid(void) {
Brad Bishop19323692019-04-05 15:28:33 -0400285 if (streq(p, "4294967295"))
286 return 0;
287
288- r = write_string_file("/proc/self/loginuid", "4294967295", WRITE_STRING_FILE_DISABLE_BUFFER);
289+ r = write_string_file("/proc/self/loginuid", "4294967295", 0);
290 if (r < 0) {
291 log_error_errno(r,
292 "Failed to reset audit login UID. This probably means that your kernel is too\n"
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700293@@ -3948,13 +3948,13 @@ static int setup_uid_map(pid_t pid) {
Brad Bishop19323692019-04-05 15:28:33 -0400294
295 xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);
296 xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, arg_uid_shift, arg_uid_range);
297- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER);
298+ r = write_string_file(uid_map, line, 0);
299 if (r < 0)
300 return log_error_errno(r, "Failed to write UID map: %m");
301
302 /* We always assign the same UID and GID ranges */
303 xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);
304- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER);
305+ r = write_string_file(uid_map, line, 0);
306 if (r < 0)
307 return log_error_errno(r, "Failed to write GID map: %m");
308
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600309diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c
310index f197f715c7..077f893177 100644
311--- a/src/shared/cgroup-setup.c
312+++ b/src/shared/cgroup-setup.c
313@@ -267,7 +267,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500314
315 xsprintf(c, PID_FMT "\n", pid);
316
317- r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
318+ r = write_string_file(fs, c, 0);
319 if (r < 0)
320 return r;
321
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600322@@ -799,7 +799,7 @@ int cg_enable_everywhere(
Andrew Geissler82c905d2020-04-13 13:39:40 -0500323 return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p);
324 }
325
326- r = write_string_stream(f, s, WRITE_STRING_FILE_DISABLE_BUFFER);
327+ r = write_string_stream(f, s, 0);
328 if (r < 0) {
329 log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m",
330 FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600331diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700332index 262d4cea66..0523e8dc9b 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600333--- a/src/sleep/sleep.c
334+++ b/src/sleep/sleep.c
335@@ -48,7 +48,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca
Andrew Geissler82c905d2020-04-13 13:39:40 -0500336 assert(hibernate_location->swap);
Brad Bishop19323692019-04-05 15:28:33 -0400337
Andrew Geissler82c905d2020-04-13 13:39:40 -0500338 xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno));
339- r = write_string_file("/sys/power/resume", resume_str, WRITE_STRING_FILE_DISABLE_BUFFER);
340+ r = write_string_file("/sys/power/resume", resume_str, 0);
341 if (r < 0)
342 return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m",
343 hibernate_location->swap->device, resume_str);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600344@@ -75,7 +75,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca
Andrew Geissler82c905d2020-04-13 13:39:40 -0500345 }
Brad Bishop19323692019-04-05 15:28:33 -0400346
Andrew Geissler82c905d2020-04-13 13:39:40 -0500347 xsprintf(offset_str, "%" PRIu64, hibernate_location->offset);
Brad Bishop19323692019-04-05 15:28:33 -0400348- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER);
349+ r = write_string_file("/sys/power/resume_offset", offset_str, 0);
350 if (r < 0)
Andrew Geissler82c905d2020-04-13 13:39:40 -0500351 return log_debug_errno(r, "Failed to write swap file offset to /sys/power/resume_offset for '%s': '%s': %m",
352 hibernate_location->swap->device, offset_str);
Andrew Geissler635e0e42020-08-21 15:58:33 -0500353@@ -92,7 +92,7 @@ static int write_mode(char **modes) {
Brad Bishop19323692019-04-05 15:28:33 -0400354 STRV_FOREACH(mode, modes) {
355 int k;
356
357- k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
358+ k = write_string_file("/sys/power/disk", *mode, 0);
359 if (k >= 0)
360 return 0;
361
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600362@@ -114,7 +114,7 @@ static int write_state(FILE **f, char **states) {
Brad Bishop19323692019-04-05 15:28:33 -0400363 STRV_FOREACH(state, states) {
364 int k;
365
366- k = write_string_stream(*f, *state, WRITE_STRING_FILE_DISABLE_BUFFER);
367+ k = write_string_stream(*f, *state, 0);
368 if (k >= 0)
369 return 0;
370 log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m", *state);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600371diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700372index d1c3febdd5..1cc68694d1 100644
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600373--- a/src/vconsole/vconsole-setup.c
374+++ b/src/vconsole/vconsole-setup.c
375@@ -116,7 +116,7 @@ static int toggle_utf8_vc(const char *name, int fd, bool utf8) {
Brad Bishop19323692019-04-05 15:28:33 -0400376 static int toggle_utf8_sysfs(bool utf8) {
377 int r;
378
379- r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), WRITE_STRING_FILE_DISABLE_BUFFER);
380+ r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), 0);
381 if (r < 0)
382 return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
383