summaryrefslogtreecommitdiffstats
path: root/src/core/core-varlink.c
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-07-23 17:06:57 +0200
committerMike Yuan <me@yhndnzj.com>2024-07-23 19:38:58 +0200
commit3ff91850a5ae783dc70416025908b4eac211c199 (patch)
tree1e101536c78253d3e6053a3d8cf81d9da680f78d /src/core/core-varlink.c
parentcore-varlink: add missing runtime_scope check for manager_varlink_init_user() (diff)
downloadsystemd-3ff91850a5ae783dc70416025908b4eac211c199.tar.xz
systemd-3ff91850a5ae783dc70416025908b4eac211c199.zip
core-varlink: do not log about ENOENT if oomd isn't available
This is simply too noisy, since every invocation of manager_varlink_send_managed_oom_update() would try to connect to oomd if not already.
Diffstat (limited to 'src/core/core-varlink.c')
-rw-r--r--src/core/core-varlink.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/core-varlink.c b/src/core/core-varlink.c
index 9051ab3111..93dfdd2e26 100644
--- a/src/core/core-varlink.c
+++ b/src/core/core-varlink.c
@@ -626,13 +626,14 @@ static int manager_varlink_init_user(Manager *m) {
return 0;
r = sd_varlink_connect_address(&link, VARLINK_ADDR_PATH_MANAGED_OOM_USER);
- if (r < 0) {
- if (r == -ENOENT || ERRNO_IS_DISCONNECT(r)) {
- log_debug("systemd-oomd varlink unix socket not found, skipping user manager varlink setup");
- return 0;
- }
- return log_error_errno(r, "Failed to connect to %s: %m", VARLINK_ADDR_PATH_MANAGED_OOM_USER);
+ if (r == -ENOENT)
+ return 0;
+ if (ERRNO_IS_NEG_DISCONNECT(r)) {
+ log_debug_errno(r, "systemd-oomd varlink socket isn't available, skipping user manager varlink setup: %m");
+ return 0;
}
+ if (r < 0)
+ return log_error_errno(r, "Failed to connect to '%s': %m", VARLINK_ADDR_PATH_MANAGED_OOM_USER);
sd_varlink_set_userdata(link, m);