Commits

Kay Sievers  committed bb3d839

udev: use only oom_score_adj interface

  • Participants
  • Parent commits bf63258

Comments (0)

Files changed (1)

 
                 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) {
-                                err(udev, "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);
                 }