From e61adc0d897074d8c2ca8e0f7bf08fa2985d9b01 Mon Sep 17 00:00:00 2001 From: Wen Hui Date: Fri, 21 Aug 2020 16:37:49 -0400 Subject: [PATCH] fix make warnings (#7692) --- src/server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server.c b/src/server.c index 454c57862..5e2f6a8b0 100644 --- a/src/server.c +++ b/src/server.c @@ -2551,9 +2551,6 @@ static void readOOMScoreAdj(void) { * depending on current role. */ int setOOMScoreAdj(int process_class) { - int fd; - int val; - char buf[64]; if (!server.oom_score_adj) return C_OK; if (process_class == -1) @@ -2562,6 +2559,10 @@ int setOOMScoreAdj(int process_class) { serverAssert(process_class >= 0 && process_class < CONFIG_OOM_COUNT); #ifdef HAVE_PROC_OOM_SCORE_ADJ + int fd; + int val; + char buf[64]; + val = server.oom_score_adj_base + server.oom_score_adj_values[process_class]; if (val > 1000) val = 1000; if (val < -1000) val = -1000;