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...
This commit is contained in:
@@ -449,8 +449,7 @@ int netdev_generate_hw_addr(
|
||||
memcpy(a.bytes, &result, a.length);
|
||||
|
||||
if (ether_addr_is_null(&a.ether) || ether_addr_is_broadcast(&a.ether)) {
|
||||
log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to generate persistent MAC address, ignoring: %m");
|
||||
log_netdev_warning(netdev, "Failed to generate persistent MAC address, ignoring.");
|
||||
a = HW_ADDR_NULL;
|
||||
goto finalize;
|
||||
}
|
||||
@@ -458,8 +457,7 @@ int netdev_generate_hw_addr(
|
||||
break;
|
||||
case ARPHRD_INFINIBAND:
|
||||
if (result == 0) {
|
||||
log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
|
||||
"Failed to generate persistent MAC address: %m");
|
||||
log_netdev_warning(netdev, "Failed to generate persistent MAC address.");
|
||||
goto finalize;
|
||||
}
|
||||
|
||||
|
||||
@@ -1073,9 +1073,7 @@ static int get_gateway_description(
|
||||
}
|
||||
|
||||
if (type != RTM_NEWNEIGH) {
|
||||
log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"Got unexpected netlink message type %u, ignoring",
|
||||
type);
|
||||
log_error("Got unexpected netlink message type %u, ignoring.", type);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1086,7 +1084,7 @@ static int get_gateway_description(
|
||||
}
|
||||
|
||||
if (fam != family) {
|
||||
log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Got invalid rtnl family %d, ignoring", fam);
|
||||
log_error("Got invalid rtnl family %d, ignoring.", fam);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user