]> git.ipfire.org Git - thirdparty/systemd.git/commit
oomd: Return tristate status from oomd_cgroup_kill_mark() 40690/head
authorChris Down <chris@chrisdown.name>
Sun, 15 Feb 2026 17:31:12 +0000 (01:31 +0800)
committerChris Down <chris@chrisdown.name>
Sun, 15 Feb 2026 17:39:21 +0000 (01:39 +0800)
commite93511b10ea82bb65f4f5b38f98c52340eb20f83
tree5474963890a1b3616426dfb98aaa84aaf0edf597
parentf4f1956d429668199a4cda9da332ca32b6e460de
oomd: Return tristate status from oomd_cgroup_kill_mark()

oomd_cgroup_kill_mark() currently returns 0 on all non-error paths. But
the manager only logs that it marked for killing on `if (r > 0)`, which
is thus unreachable.

Changing it to `r >= 0` would also be wrong, because then we would log
on no-op paths.

So let's fix this by making the return value express what actually
happened:

- < 0: failure to queue the kill state
-   0: no new mark was created (already queued or dry-run)
- > 0: a new kill state was queued
src/oom/oomd-manager.c
src/oom/oomd-util.c