Reduction of 48 bytes in compiled size. No functional difference.
-pedantic was removed as %m is a GNU extension.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
project(odhcp6c C)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c99")
-add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra -pedantic)
+add_definitions(-D_GNU_SOURCE -Wall -Werror -Wextra)
if(${EXT_PREFIX_CLASS})
add_definitions(-DEXT_PREFIX_CLASS=${EXT_PREFIX_CLASS})
if (sendmsg(sock, &msg, 0) < 0) {
char in6_str[INET6_ADDRSTRLEN];
- syslog(LOG_ERR, "Failed to send DHCPV6 message to %s (%s)",
+ syslog(LOG_ERR, "Failed to send DHCPV6 message to %s (%m)",
inet_ntop(AF_INET6, (const void *)&srv.sin6_addr,
- in6_str, sizeof(in6_str)), strerror(errno));
+ in6_str, sizeof(in6_str)));
}
}
init_dhcpv6(ifname, client_options, sol_timeout) ||
ra_init(ifname, &ifid, ra_options, ra_holdoff_interval) ||
script_init(script, ifname)) {
- syslog(LOG_ERR, "failed to initialize: %s", strerror(errno));
+ syslog(LOG_ERR, "failed to initialize: %m");
return 3;
}
if (daemonize) {
openlog("odhcp6c", LOG_PID, LOG_DAEMON); // Disable LOG_PERROR
if (daemon(0, 0)) {
- syslog(LOG_ERR, "Failed to daemonize: %s",
- strerror(errno));
+ syslog(LOG_ERR, "Failed to daemonize: %m");
return 4;
}