blob: e95d2ae0781546a424f192eb37c9a553effeebd2 [file] [log] [blame]
Andrew Geisslerd1e89492021-02-12 15:35:20 -06001From 55af446156da863b5b36a1109845858956a4c274 Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 4 Jul 2018 15:00:44 +0800
Andrew Geisslerd1e89492021-02-12 15:35:20 -06004Subject: [PATCH 14/26] Do not disable buffering when writing to oom_score_adj
Brad Bishop19323692019-04-05 15:28:33 -04005
6On musl, disabling buffering when writing to oom_score_adj will
7cause the following error.
8
9 Failed to adjust OOM setting: Invalid argument
10
11This error appears for systemd-udevd.service and dbus.service.
12This is because kernel receives '-' instead of the whole '-900'
13if buffering is disabled.
14
15This is libc implementation specific, as glibc does not have this issue.
16
17Upstream-Status: Inappropriate [musl specific]
18
19Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Brad Bishopa34c0302019-09-23 22:34:48 -040020[rebased for systemd 243]
21Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Brad Bishop19323692019-04-05 15:28:33 -040022---
23 src/basic/process-util.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
Andrew Geisslerd1e89492021-02-12 15:35:20 -060026diff --git a/src/basic/process-util.c b/src/basic/process-util.c
27index 4417101569..556dab8ebf 100644
28--- a/src/basic/process-util.c
29+++ b/src/basic/process-util.c
Andrew Geissler635e0e42020-08-21 15:58:33 -050030@@ -1536,7 +1536,7 @@ int set_oom_score_adjust(int value) {
Brad Bishop19323692019-04-05 15:28:33 -040031 sprintf(t, "%i", value);
32
33 return write_string_file("/proc/self/oom_score_adj", t,
34- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
35+ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
36 }
37
Andrew Geissler82c905d2020-04-13 13:39:40 -050038 int pidfd_get_pid(int fd, pid_t *ret) {
Andrew Geisslerd1e89492021-02-12 15:35:20 -060039--
402.27.0
41