]> err.no Git - systemd/commitdiff
remove support for deprecated /proc/self/oom_adj
authorKay Sievers <kay@vrfy.org>
Mon, 4 Jun 2012 14:41:10 +0000 (16:41 +0200)
committerKay Sievers <kay@vrfy.org>
Mon, 4 Jun 2012 14:41:10 +0000 (16:41 +0200)
src/core/dbus-execute.c
src/core/execute.c

index f1a9da0c57d08bee37a1bbaa6f7e4b53e04b568b..9322cdfd86e8c7568a12381af64f14e243ce6bbe 100644 (file)
@@ -83,14 +83,6 @@ int bus_execute_append_oom_score_adjust(DBusMessageIter *i, const char *property
                 if (read_one_line_file("/proc/self/oom_score_adj", &t) >= 0) {
                         safe_atoi(t, &n);
                         free(t);
-                } else if (read_one_line_file("/proc/self/oom_adj", &t) >= 0) {
-                        safe_atoi(t, &n);
-                        free(t);
-
-                        if (n == OOM_ADJUST_MAX)
-                                n = OOM_SCORE_ADJ_MAX;
-                        else
-                                n = (n * OOM_SCORE_ADJ_MAX) / -OOM_DISABLE;
                 }
         }
 
index 3ef4eafa7f22488a31fe6a2264f7ce33a0a61d26..1b56f6b5f442742b46a51edbad671662bf3baedd 100644 (file)
@@ -1129,22 +1129,9 @@ int exec_spawn(ExecCommand *command,
                         char_array_0(t);
 
                         if (write_one_line_file("/proc/self/oom_score_adj", t) < 0) {
-                                /* Compatibility with Linux <= 2.6.35 */
-
-                                int adj;
-
-                                adj = (context->oom_score_adjust * -OOM_DISABLE) / OOM_SCORE_ADJ_MAX;
-                                adj = CLAMP(adj, OOM_DISABLE, OOM_ADJUST_MAX);
-
-                                snprintf(t, sizeof(t), "%i", adj);
-                                char_array_0(t);
-
-                                if (write_one_line_file("/proc/self/oom_adj", t) < 0
-                                    && errno != EACCES) {
-                                        err = -errno;
-                                        r = EXIT_OOM_ADJUST;
-                                        goto fail_child;
-                                }
+                                err = -errno;
+                                r = EXIT_OOM_ADJUST;
+                                goto fail_child;
                         }
                 }