From 4e494e6aace40a356e646414b48f32c49ec7bbd8 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 30 Apr 2024 22:54:12 +0900 Subject: tree-wise: several cleanups for logging - drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate error code, - drop unnecessary '%m' in error message when the error code is specified with SYNTHETIC_ERRNO(), - add missing full stop at the end of log message, - use RET_GATHER(), - add missing ", ignoring.", - upeercase the first letter, etc., etc... --- src/udev/udev-builtin-net_id.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/udev/udev-builtin-net_id.c') diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index ac4541edd7..384a1f31cb 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -814,7 +814,7 @@ static int names_devicetree(sd_device *dev, const char *prefix, EventMode mode) ofnode_path = path_startswith(ofnode_syspath, devicetree_syspath); if (!ofnode_path) return log_device_debug_errno(ofnode_dev, SYNTHETIC_ERRNO(EINVAL), - "The device '%s' is not a child device of '%s': %m", + "The device '%s' is not a child device of '%s'.", ofnode_syspath, devicetree_syspath); /* Get back our leading / to match the contents of the aliases */ @@ -855,7 +855,7 @@ static int names_devicetree(sd_device *dev, const char *prefix, EventMode mode) /* ...but make sure we don't have an alias conflict */ if (i == 0 && device_get_sysattr_value_filtered(aliases_dev, conflict, NULL) >= 0) return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EEXIST), - "Ethernet alias conflict: ethernet and ethernet0 both exist"); + "Ethernet alias conflict: ethernet and ethernet0 both exist."); char str[ALTIFNAMSIZ]; if (snprintf_ok(str, sizeof str, "%sd%u", prefix, i)) @@ -1232,7 +1232,7 @@ static int names_xen(sd_device *dev, const char *prefix, EventMode mode) { p = startswith(vif, "vif-"); if (!p) - return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL), "Invalid vif name: %s: %m", vif); + return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL), "Invalid vif name: %s.", vif); r = safe_atou_full(p, SAFE_ATO_REFUSE_PLUS_MINUS | SAFE_ATO_REFUSE_LEADING_ZERO | SAFE_ATO_REFUSE_LEADING_WHITESPACE | 10, &id); -- cgit v1.2.3