Previously, we silently ignored this, but now that we're more careful
about the contexts in which we try to reset the OOM score and whether
we log failures as a warning, we can let the dbus-daemon-launch-helper
show a message if it can't write there.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
226f24144a4db4898a1f5958293d200b975baee0)
/* Success */
ret = TRUE;
}
- else
+ else if (errno == ENOENT)
{
- /* TODO: Historically we ignored this error, although ideally we
- * would diagnose it */
+ /* If /proc/self/oom_score_adj doesn't exist, assume the kernel
+ * doesn't support this feature and ignore it. */
ret = TRUE;
}
+ else
+ {
+ ret = FALSE;
+ error_str = "open(/proc/self/oom_score_adj)";
+ saved_errno = errno;
+ goto out;
+ }
out:
if (fd >= 0)