forked from pool/audit
426a43d7b5
Passt. :-) OBS-URL: https://build.opensuse.org/request/show/49204 OBS-URL: https://build.opensuse.org/package/show/security/audit?expand=0&rev=18
22 lines
620 B
Diff
22 lines
620 B
Diff
Index: src/auditd.c
|
|
===================================================================
|
|
--- src/auditd.c.orig
|
|
+++ src/auditd.c
|
|
@@ -265,7 +265,15 @@ static int write_pid_file(void)
|
|
static void avoid_oom_killer(void)
|
|
{
|
|
int oomfd;
|
|
-
|
|
+
|
|
+ /* Newer kernels (noticed in 2.6.36) */
|
|
+ oomfd = open("/proc/self/oom_score_adj", O_NOFOLLOW | O_WRONLY);
|
|
+ if (oomfd >= 0) {
|
|
+ (void)write(oomfd, "0", 1);
|
|
+ close(oomfd);
|
|
+ return;
|
|
+ }
|
|
+ /* Older kernel */
|
|
oomfd = open("/proc/self/oom_adj", O_NOFOLLOW | O_WRONLY);
|
|
if (oomfd >= 0) {
|
|
(void)write(oomfd, "-17", 3);
|