]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: improve logging
authorSusant Sahani <susant@redhat.com>
Thu, 11 Jun 2015 07:41:33 +0000 (13:11 +0530)
committerSusant Sahani <susant@redhat.com>
Thu, 11 Jun 2015 07:41:33 +0000 (13:11 +0530)
Replace strerror() usage with log_netdev_error_errno()

src/network/networkd-netdev-ipvlan.c

index 5189000c1fe543363c954d89050a7fda6561b371..f1c8e0ccdb1cd1e729530324e2b48d6e22f85058 100644 (file)
@@ -42,13 +42,9 @@ static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl
         assert(netdev->ifname);
 
         if (m->mode != _NETDEV_IPVLAN_MODE_INVALID) {
-        r = sd_rtnl_message_append_u16(req, IFLA_IPVLAN_MODE, m->mode);
-        if (r < 0) {
-                log_netdev_error(netdev,
-                                 "Could not append IFLA_IPVLAN_MODE attribute: %s",
-                                 strerror(-r));
-                        return r;
-                }
+                r = sd_rtnl_message_append_u16(req, IFLA_IPVLAN_MODE, m->mode);
+                if (r < 0)
+                        return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPVLAN_MODE attribute: %m");
         }
 
         return 0;