diff options
author | Simon McVittie <smcv@collabora.com> | 2022-04-01 18:58:34 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2022-07-16 22:23:07 +0000 |
commit | ad72e3b9e352f6cb1d568bb01f0d79c2a63fc276 (patch) | |
tree | 68a7962bba7ea9b99d1ceb39bd5a9a04c61f8d2c | |
parent | b3163746a981283d6bc3bf5cac3c5554395b4dea (diff) | |
download | dbus-ad72e3b9e352f6cb1d568bb01f0d79c2a63fc276.tar.gz |
activation-helper: Never crash if unable to write oom_score_adj
_dbus_warn() normally only logs a warning, but can be made fatal by
environment variables. In particular, we do that during unit testing,
which can result in a build-time test failure if dbus is built in a
sandbox environment that prevents write access.
_dbus_log() does only the logging part of _dbus_warn(), which seems
more appropriate here.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | bus/activation-helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bus/activation-helper.c b/bus/activation-helper.c index 8a4fd732..df0472ce 100644 --- a/bus/activation-helper.c +++ b/bus/activation-helper.c @@ -348,7 +348,7 @@ exec_for_correct_user (char *exec, char *user, DBusError *error) /* Resetting the OOM score adjustment is best-effort, so we don't * treat a failure to do so as fatal. */ if (!_dbus_reset_oom_score_adj (&error_str)) - _dbus_warn ("%s: %s", error_str, strerror (errno)); + _dbus_log (DBUS_SYSTEM_LOG_WARNING, "%s: %s", error_str, strerror (errno)); if (!switch_user (user, error)) return FALSE; |