~xdavidwu/systemd-apkbuilds

ref: 41b96cafd0e6d4a12252bbbb6564230ecc968f30 systemd-apkbuilds/systemd/0100-Do-not-buffer-on-systemd-sleep.patch -rw-r--r-- 1006 bytes
41b96cafPinghao Wu systemd: 256.2 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index 0402bb07f3..a6cbb45340 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -139,7 +139,7 @@ static int write_state(int fd, char * const *states) {
                 if (k < 0)
                         return RET_GATHER(r, k);
 
-                k = write_string_stream(f, *state, 0);
+                k = write_string_stream(f, *state, WRITE_STRING_FILE_DISABLE_BUFFER);
                 if (k >= 0) {
                         log_debug("Using sleep state '%s'.", *state);
                         return 0;
@@ -157,7 +157,7 @@ static int write_mode(const char *path, char * const *modes) {
         assert(path);
 
         STRV_FOREACH(mode, modes) {
-                r = write_string_file(path, *mode, 0);
+                r = write_string_file(path, *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
                 if (r >= 0) {
                         log_debug("Using sleep mode '%s' for %s.", *mode, path);
                         return 0;