diff options
-rw-r--r-- | dbus/dbus-sysdeps-util-unix.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c index ffbc7aea..bed6fd3e 100644 --- a/dbus/dbus-sysdeps-util-unix.c +++ b/dbus/dbus-sysdeps-util-unix.c @@ -1658,12 +1658,19 @@ _dbus_reset_oom_score_adj (const char **error_str_p) /* 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) |