summaryrefslogtreecommitdiffstats
path: root/common.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-05 13:12:35 +0000
committerRoy Marples <roy@marples.name>2008-09-05 13:12:35 +0000
commitf6de5860b6c6a47c21d09ee4203895f182c01eaa (patch)
tree92744ef6e22857713422dcf2ae731911a5e451f0 /common.c
parent99d755f98fbd68ea54a199f5ce27516e37108cd1 (diff)
downloaddhcpcd-f6de5860b6c6a47c21d09ee4203895f182c01eaa.tar.xz
As our logger calls emulate syslog, we can use %m. However, this means we have to convert it for printf as POSIX does not require that printf supports it. This also means we drop -pedantic from our GCC flags.
Diffstat (limited to 'common.c')
-rw-r--r--common.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common.c b/common.c
index efcdd80a..2daba9f4 100644
--- a/common.c
+++ b/common.c
@@ -33,7 +33,6 @@
#include <sys/param.h>
#include <sys/time.h>
-#include <errno.h>
#include <fcntl.h>
#ifdef BSD
# include <paths.h>
@@ -164,7 +163,7 @@ set_cloexec(int fd)
if ((flags = fcntl(fd, F_GETFD, 0)) == -1
|| fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
{
- logger(LOG_ERR, "fcntl: %s", strerror(errno));
+ logger(LOG_ERR, "fcntl: %m");
return -1;
}
return 0;
@@ -178,7 +177,7 @@ set_nonblock(int fd)
if ((flags = fcntl(fd, F_GETFL, 0)) == -1
|| fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1)
{
- logger(LOG_ERR, "fcntl: %s", strerror(errno));
+ logger(LOG_ERR, "fcntl: %m");
return -1;
}
return 0;