tree-wide: when %m is used in log_*, always specify errno explicitly

All those uses were correct, but I think it's better to be explicit.
Using implicit errno is too error prone, and with this change we can require
(in the sense of a style guideline) that the code is always specified.

Helpful query: git grep -n -P 'log_[^s][a-z]+\(.*%m'
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-05-19 14:24:03 -04:00
parent 35bca925f9
commit 25f027c5ef
12 changed files with 28 additions and 35 deletions
+4 -4
View File
@@ -1655,7 +1655,8 @@ static int client_receive_message_udp(
if (errno == EAGAIN || errno == EINTR)
return 0;
return log_dhcp_client_errno(client, errno, "Could not receive message from UDP socket: %m");
return log_dhcp_client_errno(client, errno,
"Could not receive message from UDP socket: %m");
}
if ((size_t) len < sizeof(DHCPMessage)) {
log_dhcp_client(client, "Too small to be a DHCP message: ignoring");
@@ -1748,9 +1749,8 @@ static int client_receive_message_raw(
if (errno == EAGAIN || errno == EINTR)
return 0;
log_dhcp_client(client, "Could not receive message from raw socket: %m");
return -errno;
return log_dhcp_client_errno(client, errno,
"Could not receive message from raw socket: %m");
} else if ((size_t)len < sizeof(DHCPPacket))
return 0;