summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2015-06-10 12:20:45 +0530
committerSusant Sahani <susant@redhat.com>2015-06-10 12:22:39 +0530
commit7676666c6a4e0c49ce56ae600854d01a14b2338f (patch)
treeed761216048cbfd82735ac8c6dd59f0f23097b20 /src
parentf545680e3d4fd84931704406a352f14d66716572 (diff)
network: veth imprve logging
Replaces a lof of strerror() usage with log_netdev_error_errno()
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-netdev-veth.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/network/networkd-netdev-veth.c b/src/network/networkd-netdev-veth.c
index 9e9e1225e7..7bb02d1ae1 100644
--- a/src/network/networkd-netdev-veth.c
+++ b/src/network/networkd-netdev-veth.c
@@ -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;
}