dhcp: replace strerror() with %m

This commit is contained in:
Yu Watanabe
2019-07-05 02:43:56 +09:00
parent 442ac2692a
commit 7fa6223f67
2 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -576,7 +576,7 @@ static void client_stop(sd_dhcp_client *client, int error) {
assert(client);
if (error < 0)
log_dhcp_client(client, "STOPPED: %s", strerror(-error));
log_dhcp_client_errno(client, error, "STOPPED: %m");
else if (error == SD_DHCP_CLIENT_EVENT_STOP)
log_dhcp_client(client, "STOPPED");
else
+4 -12
View File
@@ -205,12 +205,8 @@ int dhcp6_lease_set_dns(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen) {
r = dhcp6_option_parse_ip6addrs(optval, optlen, &lease->dns,
lease->dns_count,
&lease->dns_allocated);
if (r < 0) {
log_dhcp6_client(client, "Invalid DNS server option: %s",
strerror(-r));
return r;
}
if (r < 0)
return log_dhcp6_client_errno(client, r, "Invalid DNS server option: %m");
lease->dns_count = r;
@@ -336,12 +332,8 @@ int dhcp6_lease_set_sntp(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen)
r = dhcp6_option_parse_ip6addrs(optval, optlen, &lease->ntp,
lease->ntp_count,
&lease->ntp_allocated);
if (r < 0) {
log_dhcp6_client(client, "Invalid SNTP server option: %s",
strerror(-r));
return r;
}
if (r < 0)
return log_dhcp6_client_errno(client, r, "Invalid SNTP server option: %m");
lease->ntp_count = r;