~xdavidwu/systemd-apkbuilds

ref: d3b37a2786a86c3c03a7e6c10749de32f4908a24 systemd-apkbuilds/systemd/0100-Do-not-buffer-on-systemd-sleep.patch -rw-r--r-- 921 bytes
d3b37a27Pinghao Wu systemd: 255.9 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -137,7 +137,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;
@@ -155,7 +155,7 @@ static int write_mode(char * const *modes) {
         STRV_FOREACH(mode, modes) {
                 int k;
 
-                k = write_string_file("/sys/power/disk", *mode, 0);
+                k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
                 if (k >= 0) {
                         log_debug("Using sleep disk mode '%s'.", *mode);
                         return 0;