From: Kay Sievers Date: Wed, 25 Apr 2012 23:49:15 +0000 (+0200) Subject: udev: use only oom_score_adj interface X-Git-Tag: v183~189 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c693ccc0a2a2d44eecf6f5eccaa3d1948c5e9532;p=systemd udev: use only oom_score_adj interface --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 16255109..59e2cfac 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1255,18 +1255,8 @@ int main(int argc, char *argv[]) setsid(); - fd = open("/proc/self/oom_score_adj", O_RDWR); - if (fd < 0) { - /* Fallback to old interface */ - fd = open("/proc/self/oom_adj", O_RDWR); - if (fd < 0) { - log_error("error disabling OOM: %m\n"); - } else { - /* OOM_DISABLE == -17 */ - write(fd, "-17", 3); - close(fd); - } - } else { + fd = open("/proc/self/oom_score_adj", O_RDWR|O_CLOEXEC); + if (fd >= 0) { write(fd, "-1000", 5); close(fd); }