Based on patch from dparalen <vetrisko@gmail.com>.
Fixes: https://github.com/util-linux/util-linux/issues/3095
Signed-off-by: Karel Zak <kzak@redhat.com>
#define _PATH_PROC_FDDIR "/proc/self/fd"
#define _PATH_PROC_TIMENS_OFF "/proc/self/timens_offsets"
+#define _PATH_PROC_OOM_ADJ "/proc/self/oom_score_adj"
+
#define _PATH_PROC_ATTR_CURRENT "/proc/self/attr/current"
#define _PATH_PROC_ATTR_EXEC "/proc/self/attr/exec"
#define _PATH_PROC_CAPLASTCAP "/proc/sys/kernel/cap_last_cap"
#include "c.h"
#include "xalloc.h"
#include "closestream.h"
+#include "pathnames.h"
+#include "path.h"
#include "swapprober.h"
#include "swapon-common.h"
errtryhelp(SWAPOFF_EX_USAGE);
}
+ /* prevent the OOM killer from killing myself */
+ ul_path_write_string(NULL, "-1000", _PATH_PROC_OOM_ADJ);
+
mnt_init_debug(0);
mntcache = mnt_new_cache();