summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 17:09:20 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 17:17:51 +0100
commitc33b329709ebe2755181980a050d02ec7c81ed87 (patch)
tree39080c428c72c90daddbe1c08d45c181adf1476c /src/network/networkd-address.c
parent5567fafbc9d83a1391f23ecdbe698a3c03929370 (diff)
treewide: more log_*_errno() conversions, multiline calls
Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r--src/network/networkd-address.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index e95184b8ff..9502fa8caa 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -118,8 +118,7 @@ int address_drop(Address *address, Link *link,
r = sd_rtnl_message_new_addr(link->manager->rtnl, &req, RTM_DELADDR,
link->ifindex, address->family);
if (r < 0) {
- log_error("Could not allocate RTM_DELADDR message: %s",
- strerror(-r));
+ log_error_errno(r, "Could not allocate RTM_DELADDR message: %m");
return r;
}
@@ -134,8 +133,7 @@ int address_drop(Address *address, Link *link,
else if (address->family == AF_INET6)
r = sd_rtnl_message_append_in6_addr(req, IFA_LOCAL, &address->in_addr.in6);
if (r < 0) {
- log_error("Could not append IFA_LOCAL attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_LOCAL attribute: %m");
return r;
}
@@ -164,8 +162,7 @@ int address_update(Address *address, Link *link,
r = sd_rtnl_message_new_addr_update(link->manager->rtnl, &req,
link->ifindex, address->family);
if (r < 0) {
- log_error("Could not allocate RTM_NEWADDR message: %s",
- strerror(-r));
+ log_error_errno(r, "Could not allocate RTM_NEWADDR message: %m");
return r;
}
@@ -192,16 +189,14 @@ int address_update(Address *address, Link *link,
else if (address->family == AF_INET6)
r = sd_rtnl_message_append_in6_addr(req, IFA_LOCAL, &address->in_addr.in6);
if (r < 0) {
- log_error("Could not append IFA_LOCAL attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_LOCAL attribute: %m");
return r;
}
if (address->family == AF_INET) {
r = sd_rtnl_message_append_in_addr(req, IFA_BROADCAST, &address->broadcast);
if (r < 0) {
- log_error("Could not append IFA_BROADCAST attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_BROADCAST attribute: %m");
return r;
}
}
@@ -209,16 +204,14 @@ int address_update(Address *address, Link *link,
if (address->label) {
r = sd_rtnl_message_append_string(req, IFA_LABEL, address->label);
if (r < 0) {
- log_error("Could not append IFA_LABEL attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_LABEL attribute: %m");
return r;
}
}
r = sd_rtnl_message_append_cache_info(req, IFA_CACHEINFO, &address->cinfo);
if (r < 0) {
- log_error("Could not append IFA_CACHEINFO attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_CACHEINFO attribute: %m");
return r;
}
@@ -313,8 +306,7 @@ int address_configure(Address *address, Link *link,
r = sd_rtnl_message_new_addr(link->manager->rtnl, &req, RTM_NEWADDR,
link->ifindex, address->family);
if (r < 0) {
- log_error("Could not allocate RTM_NEWADDR message: %s",
- strerror(-r));
+ log_error_errno(r, "Could not allocate RTM_NEWADDR message: %m");
return r;
}
@@ -341,8 +333,7 @@ int address_configure(Address *address, Link *link,
else if (address->family == AF_INET6)
r = sd_rtnl_message_append_in6_addr(req, IFA_LOCAL, &address->in_addr.in6);
if (r < 0) {
- log_error("Could not append IFA_LOCAL attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_LOCAL attribute: %m");
return r;
}
@@ -352,16 +343,14 @@ int address_configure(Address *address, Link *link,
else if (address->family == AF_INET6)
r = sd_rtnl_message_append_in6_addr(req, IFA_ADDRESS, &address->in_addr_peer.in6);
if (r < 0) {
- log_error("Could not append IFA_ADDRESS attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_ADDRESS attribute: %m");
return r;
}
} else {
if (address->family == AF_INET) {
r = sd_rtnl_message_append_in_addr(req, IFA_BROADCAST, &address->broadcast);
if (r < 0) {
- log_error("Could not append IFA_BROADCAST attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_BROADCAST attribute: %m");
return r;
}
}
@@ -370,8 +359,7 @@ int address_configure(Address *address, Link *link,
if (address->label) {
r = sd_rtnl_message_append_string(req, IFA_LABEL, address->label);
if (r < 0) {
- log_error("Could not append IFA_LABEL attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_LABEL attribute: %m");
return r;
}
}
@@ -379,8 +367,7 @@ int address_configure(Address *address, Link *link,
r = sd_rtnl_message_append_cache_info(req, IFA_CACHEINFO,
&address->cinfo);
if (r < 0) {
- log_error("Could not append IFA_CACHEINFO attribute: %s",
- strerror(-r));
+ log_error_errno(r, "Could not append IFA_CACHEINFO attribute: %m");
return r;
}