mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 23:51:28 +03:00
network: veth imprve logging
Replaces a lof of strerror() usage with log_netdev_error_errno()
This commit is contained in:
parent
f545680e3d
commit
7676666c6a
@ -35,12 +35,8 @@ static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_m
|
||||
assert(m);
|
||||
|
||||
r = sd_rtnl_message_open_container(m, VETH_INFO_PEER);
|
||||
if (r < 0) {
|
||||
log_netdev_error(netdev,
|
||||
"Could not append VETH_INFO_PEER attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_netdev_error_errno(netdev, r, "Could not append VETH_INFO_PEER attribute: %m");
|
||||
|
||||
if (v->ifname_peer) {
|
||||
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, v->ifname_peer);
|
||||
@ -50,21 +46,13 @@ static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_m
|
||||
|
||||
if (v->mac_peer) {
|
||||
r = sd_rtnl_message_append_ether_addr(m, IFLA_ADDRESS, v->mac_peer);
|
||||
if (r < 0) {
|
||||
log_netdev_error(netdev,
|
||||
"Could not append IFLA_ADDRESS attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_netdev_error_errno(netdev, r, "Could not append IFLA_ADDRESS attribute: %m");
|
||||
}
|
||||
|
||||
r = sd_rtnl_message_close_container(m);
|
||||
if (r < 0) {
|
||||
log_netdev_error(netdev,
|
||||
"Could not append IFLA_INFO_DATA attribute: %s",
|
||||
strerror(-r));
|
||||
return r;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_netdev_error_errno(netdev, r, "Could not append IFLA_INFO_DATA attribute: %m");
|
||||
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user