]> git.armaanb.net Git - slock.git/commitdiff
Refactor dontkillme()
authorFRIGN <dev@frign.de>
Mon, 22 Aug 2016 23:45:46 +0000 (01:45 +0200)
committerMarkus Teich <markus.teich@stusta.mhn.de>
Tue, 30 Aug 2016 23:06:44 +0000 (01:06 +0200)
- Use file pointers instead of raw I/O, inspired by Kernel code.
- Use OOM_SCORE_ADJ_MIN from linux/oom.h instead of working with
  magic values.
- Stricter error checking and descriptive error messages.

The reasoning for using the constant rather than magic values lies
in the fact that this ensures people get the message.
With "-1000", a code reviewer would question if that is really the
lowest possible number or just an arbitrary value.
The kernel ABI probably won't change, but even in the case, we wouldn't
have to modify the code. The OOM killer only is guaranteed to not
kill you if you have OOM_SCORE_ADJ_MIN.


No differences found