1
0
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:
Susant Sahani 2015-06-10 12:20:45 +05:30
parent f545680e3d
commit 7676666c6a

View File

@ -35,12 +35,8 @@ static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_m
assert(m); assert(m);
r = sd_rtnl_message_open_container(m, VETH_INFO_PEER); r = sd_rtnl_message_open_container(m, VETH_INFO_PEER);
if (r < 0) { if (r < 0)
log_netdev_error(netdev, return log_netdev_error_errno(netdev, r, "Could not append VETH_INFO_PEER attribute: %m");
"Could not append VETH_INFO_PEER attribute: %s",
strerror(-r));
return r;
}
if (v->ifname_peer) { if (v->ifname_peer) {
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, 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) { if (v->mac_peer) {
r = sd_rtnl_message_append_ether_addr(m, IFLA_ADDRESS, v->mac_peer); r = sd_rtnl_message_append_ether_addr(m, IFLA_ADDRESS, v->mac_peer);
if (r < 0) { if (r < 0)
log_netdev_error(netdev, return log_netdev_error_errno(netdev, r, "Could not append IFLA_ADDRESS attribute: %m");
"Could not append IFLA_ADDRESS attribute: %s",
strerror(-r));
return r;
}
} }
r = sd_rtnl_message_close_container(m); r = sd_rtnl_message_close_container(m);
if (r < 0) { if (r < 0)
log_netdev_error(netdev, return log_netdev_error_errno(netdev, r, "Could not append IFLA_INFO_DATA attribute: %m");
"Could not append IFLA_INFO_DATA attribute: %s",
strerror(-r));
return r;
}
return r; return r;
} }