From e8a7722eeca0dc76f2dca475dc5946309ced4d58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Nov 2025 08:56:04 +0100 Subject: [PATCH] tree-wide: fix log messages using %m without an errno --- src/home/homed-home.c | 4 ++-- src/network/networkd-ipv4ll.c | 2 +- src/network/networkd-nexthop.c | 2 +- src/network/networkd-wifi.c | 4 ++-- src/network/networkd-wiphy.c | 10 ++++------ src/shared/discover-image.c | 4 ++-- src/shared/fork-notify.c | 2 +- src/udev/net/link-config.c | 2 +- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/home/homed-home.c b/src/home/homed-home.c index e4f3487473a..56eb30d08e6 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -2189,7 +2189,7 @@ void home_process_notify(Home *h, char **l, int fd) { return (void) log_debug_errno(r, "Failed to parse SYSTEMD_LUKS_LOCK_FD value: %m"); if (r > 0) { if (taken_fd < 0) - return (void) log_debug("Got notify message with SYSTEMD_LUKS_LOCK_FD=1 but no fd passed, ignoring: %m"); + return (void) log_debug("Got notify message with SYSTEMD_LUKS_LOCK_FD=1 but no fd passed, ignoring."); close_and_replace(h->luks_lock_fd, taken_fd); @@ -2199,7 +2199,7 @@ void home_process_notify(Home *h, char **l, int fd) { home_maybe_close_luks_lock_fd(h, _HOME_STATE_INVALID); } else { if (taken_fd >= 0) - return (void) log_debug("Got notify message with SYSTEMD_LUKS_LOCK_FD=0 but fd passed, ignoring: %m"); + return (void) log_debug("Got notify message with SYSTEMD_LUKS_LOCK_FD=0 but fd passed, ignoring."); h->luks_lock_fd = safe_close(h->luks_lock_fd); } diff --git a/src/network/networkd-ipv4ll.c b/src/network/networkd-ipv4ll.c index 94fa25a4f07..23b9e80796b 100644 --- a/src/network/networkd-ipv4ll.c +++ b/src/network/networkd-ipv4ll.c @@ -155,7 +155,7 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata) { case SD_IPV4LL_EVENT_BIND: r = ipv4ll_address_claimed(ll, link); if (r < 0) { - log_link_error(link, "Failed to configure ipv4ll address: %m"); + log_link_error_errno(link, r, "Failed to configure ipv4ll address: %m"); link_enter_failed(link); return; } diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index 7d221849b47..5e5f0d0e685 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -1123,7 +1123,7 @@ int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message, log_warning_errno(r, "rtnl: could not get NHA_ID attribute, ignoring: %m"); return 0; } else if (id == 0) { - log_warning("rtnl: received nexthop message with invalid nexthop ID, ignoring: %m"); + log_warning("rtnl: received nexthop message with invalid nexthop ID, ignoring."); return 0; } diff --git a/src/network/networkd-wifi.c b/src/network/networkd-wifi.c index e0b4f8b5068..3caacef0892 100644 --- a/src/network/networkd-wifi.c +++ b/src/network/networkd-wifi.c @@ -119,7 +119,7 @@ int manager_genl_process_nl80211_config(sd_netlink *genl, sd_netlink_message *me } if (!streq(ifname, link->ifname)) { - log_link_debug(link, "nl80211: received %s(%u) message with invalid interface name '%s', ignoring: %m", + log_link_debug(link, "nl80211: received %s(%u) message with invalid interface name '%s', ignoring.", strna(nl80211_cmd_to_string(cmd)), cmd, ifname); return 0; } @@ -139,7 +139,7 @@ int manager_genl_process_nl80211_config(sd_netlink *genl, sd_netlink_message *me } if (r >= 0) { if (len == 0) { - log_link_debug(link, "nl80211: received SSID has zero length, ignoring it: %m"); + log_link_debug(link, "nl80211: received SSID has zero length, ignoring it."); ssid = mfree(ssid); } else if (strlen_ptr(ssid) != len) { log_link_debug(link, "nl80211: received SSID contains NUL characters, ignoring it."); diff --git a/src/network/networkd-wiphy.c b/src/network/networkd-wiphy.c index 5b29c5ca5c5..1dde69a43b4 100644 --- a/src/network/networkd-wiphy.c +++ b/src/network/networkd-wiphy.c @@ -409,8 +409,7 @@ int manager_genl_process_nl80211_wiphy(sd_netlink *genl, sd_netlink_message *mes (void) wiphy_get_by_index(manager, index, &w); switch (cmd) { - case NL80211_CMD_NEW_WIPHY: { - + case NL80211_CMD_NEW_WIPHY: if (!w) { r = wiphy_new(manager, message, &w); if (r < 0) { @@ -432,11 +431,10 @@ int manager_genl_process_nl80211_wiphy(sd_netlink *genl, sd_netlink_message *mes log_wiphy_warning_errno(w, r, "Failed to update wiphy, ignoring: %m"); break; - } - case NL80211_CMD_DEL_WIPHY: + case NL80211_CMD_DEL_WIPHY: if (!w) { - log_debug("The kernel removes wiphy we do not know, ignoring: %m"); + log_debug("The kernel removed wiphy we do not know, ignoring."); return 0; } @@ -445,7 +443,7 @@ int manager_genl_process_nl80211_wiphy(sd_netlink *genl, sd_netlink_message *mes break; default: - log_wiphy_debug(w, "nl80211: received %s(%u) message.", + log_wiphy_debug(w, "nl80211: received %s(%u) message, ignoring.", strna(nl80211_cmd_to_string(cmd)), cmd); } diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c index 52e1036a6b1..3ed9958d72f 100644 --- a/src/shared/discover-image.c +++ b/src/shared/discover-image.c @@ -844,7 +844,7 @@ int image_find(RuntimeScope scope, continue; } if (!result.path) { - log_debug("Found versioned directory '%s', without matching entry, skipping: %m", vp); + log_debug("Found versioned directory '%s', without matching entry, skipping.", vp); continue; } @@ -1052,7 +1052,7 @@ int image_discover( continue; } if (!result.path) { - log_debug("Found versioned directory '%s', without matching entry, skipping: %m", vp); + log_debug("Found versioned directory '%s', without matching entry, skipping.", vp); continue; } diff --git a/src/shared/fork-notify.c b/src/shared/fork-notify.c index b80dc846ee3..624ddab8d15 100644 --- a/src/shared/fork-notify.c +++ b/src/shared/fork-notify.c @@ -77,7 +77,7 @@ static int on_child_notify(sd_event_source *s, int fd, uint32_t revents, void *u return 0; } if (error <= 0) { - log_debug("Received non-positive ERRNO= notification message, ignoring: %m"); + log_debug("Received non-positive ERRNO= notification message, ignoring: %d", error); return 0; } diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index d1404fed8b1..70971ca2f56 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -917,7 +917,7 @@ static int link_apply_sr_iov_config(Link *link) { return 0; } if (n == 0) { - log_link_warning(link, "No SR-IOV virtual function exists, ignoring all [SR-IOV] sections: %m"); + log_link_warning(link, "No SR-IOV virtual functions exist, ignoring all [SR-IOV] sections."); return 0; } -- 2.47.3