From 13167bfc2f7b747d23494f5d878ddacfe237ac1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 26 Feb 2026 09:25:48 +0100 Subject: [PATCH] core/socket: fix reversed symlink direction in error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the update to 260-rc1 in Fedora Rawhide, we get a lot of messages like this: systemd[1]: systemd-resolved-monitor.socket: Failed to create symlink /run/systemd/resolve/io.systemd.Resolve.Monitor → /run/varlink/registry/io.systemd.Resolve.Monitor, ignoring: Permission denied The actual issue will need to be fixed too, but let's fix the message first. While at it, let's rename the variables to be meaningful. --- src/core/socket.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/core/socket.c b/src/core/socket.c index 0ca9d80e04..c18f28aad6 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1347,30 +1347,29 @@ static int mq_address_create( } static int socket_symlink(Socket *s) { - const char *p; int r; assert(s); - p = socket_find_symlink_target(s); - if (!p) + const char *target = socket_find_symlink_target(s); + if (!target) return 0; - STRV_FOREACH(i, s->symlinks) { - (void) mkdir_parents_label(*i, s->directory_mode); + STRV_FOREACH(linkpath, s->symlinks) { + (void) mkdir_parents_label(*linkpath, s->directory_mode); - r = symlink_idempotent(p, *i, false); + r = symlink_idempotent(target, *linkpath, false); if (r == -EEXIST && s->remove_on_stop) { - /* If there's already something where we want to create the symlink, and the destructive - * RemoveOnStop= mode is set, then we might as well try to remove what already exists and try - * again. */ + /* If there's already something where we want to create the symlink, and the + * destructive RemoveOnStop= mode is set, then we might as well try to remove what + * already exists and try again. */ - if (unlink(*i) >= 0) - r = symlink_idempotent(p, *i, false); + if (unlink(*linkpath) >= 0) + r = symlink_idempotent(target, *linkpath, false); } if (r < 0) log_unit_warning_errno(UNIT(s), r, "Failed to create symlink %s %s %s, ignoring: %m", - p, glyph(GLYPH_ARROW_RIGHT), *i); + *linkpath, glyph(GLYPH_ARROW_RIGHT), target); } return 0;