blob: b54635e8a95c8d8230c6ae9f5d6914c390fcee69 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From c7a4efb8bccb52e1714c151929c23e12bde59b82 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 4 Jul 2018 15:00:44 +0800
4Subject: [PATCH 17/24] Do not disable buffering when writing to oom_score_adj
5
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>
20---
21 src/basic/process-util.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/src/basic/process-util.c b/src/basic/process-util.c
Brad Bishopc342db32019-05-15 21:57:59 -040025index f773eea..79af915 100644
Brad Bishop19323692019-04-05 15:28:33 -040026--- a/src/basic/process-util.c
27+++ b/src/basic/process-util.c
Brad Bishopc342db32019-05-15 21:57:59 -040028@@ -1546,7 +1546,7 @@ int set_oom_score_adjust(int value) {
Brad Bishop19323692019-04-05 15:28:33 -040029 sprintf(t, "%i", value);
30
31 return write_string_file("/proc/self/oom_score_adj", t,
32- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
33+ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
34 }
35
Brad Bishopc342db32019-05-15 21:57:59 -040036 int cpus_in_affinity_mask(void) {
Brad Bishop19323692019-04-05 15:28:33 -040037--
Brad Bishopc342db32019-05-15 21:57:59 -0400382.11.0
39
Brad Bishop19323692019-04-05 15:28:33 -040040