diff options
author | Rosen Penev <rosenp@gmail.com> | 2017-12-16 19:55:04 -0800 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-12-17 20:02:02 +0100 |
commit | 7aa2594c5a127d92fa8f04328ac7b43e595bcaa7 (patch) | |
tree | 9dbfea93d259084641f30172efc65692d0540205 /src/ndp.c | |
parent | 750e457e3000187b85906814a2529ede24775325 (diff) |
odhcpd: Replace strerror(errno) with %m format
Saves a few bytes.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/ndp.c')
-rw-r--r-- | src/ndp.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -62,7 +62,7 @@ int ndp_init(void) // Open ICMPv6 socket ping_socket = socket(AF_INET6, SOCK_RAW | SOCK_CLOEXEC, IPPROTO_ICMPV6); if (ping_socket < 0) { - syslog(LOG_ERR, "Unable to open raw socket: %s", strerror(errno)); + syslog(LOG_ERR, "Unable to open raw socket: %m"); return -1; } @@ -113,8 +113,7 @@ int ndp_setup_interface(struct interface *iface, bool enable) int sock = socket(AF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_IPV6)); if (sock < 0) { - syslog(LOG_ERR, "Unable to open packet socket: %s", - strerror(errno)); + syslog(LOG_ERR, "Unable to open packet socket: %m"); ret = -1; goto out; } @@ -126,7 +125,7 @@ int ndp_setup_interface(struct interface *iface, bool enable) if (setsockopt(sock, SOL_SOCKET, SO_ATTACH_FILTER, &bpf_prog, sizeof(bpf_prog))) { - syslog(LOG_ERR, "Failed to set BPF: %s", strerror(errno)); + syslog(LOG_ERR, "Failed to set BPF: %m"); ret = -1; goto out; } |