Search
SailfishOS Open Build Service
>
Projects
>
nemo
:
devel:hw
:
maguro
>
systemd
> _service:tar_git:systemd-187-reintroduce-support-for-deprecated-oom.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:systemd-187-reintroduce-support-for-deprecated-oom.patch of Package systemd
From 8600c525cb1420570e7670c963abd19c5696b683 Mon Sep 17 00:00:00 2001 From: Kay Sievers <kay@vrfy.org> Date: Mon, 04 Jun 2012 14:41:10 +0000 Subject: remove support for deprecated /proc/self/oom_adj --- diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index f1a9da0..9322cdf 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -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; } } diff --git a/src/core/execute.c b/src/core/execute.c index 3ef4eaf..1b56f6b 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -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; } } -- cgit v0.9.0.2-2-gbebe