set_self_oom_score_adj: corrected error handling

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2021-04-01 17:16:12 +02:00
parent 2d1bd947e2
commit 3f0ece492f

View File

@@ -112,7 +112,7 @@ void set_self_oom_score_adj(main_server_st * s)
}
cleanup:
if (fd) {
if (fd >= 0) {
close(fd);
}
#endif
@@ -181,4 +181,5 @@ void drop_privileges(main_server_st * s)
mslog(s, NULL, LOG_ERR, "cannot enforce NPROC limit: %s\n",
strerror(e));
}
}
}