fix make warnings (#7692)

This commit is contained in:
Wen Hui 2020-08-21 16:37:49 -04:00 committed by GitHub
parent 89f2bfbb58
commit e61adc0d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;