From: Zbigniew Jędrzejewski-Szmek Date: Thu, 26 Feb 2026 08:25:48 +0000 (+0100) Subject: core/socket: fix reversed symlink direction in error message X-Git-Tag: v260-rc2~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=13167bfc2f7b747d23494f5d878ddacfe237ac1c;p=thirdparty%2Fsystemd.git core/socket: fix reversed symlink direction in error message 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. --- diff --git a/src/core/socket.c b/src/core/socket.c index 0ca9d80e045..c18f28aad68 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;