diff options
| author | Roy Marples <roy@marples.name> | 2008-09-05 13:12:35 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-09-05 13:12:35 +0000 |
| commit | f6de5860b6c6a47c21d09ee4203895f182c01eaa (patch) | |
| tree | 92744ef6e22857713422dcf2ae731911a5e451f0 /common.c | |
| parent | 99d755f98fbd68ea54a199f5ce27516e37108cd1 (diff) | |
| download | dhcpcd-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |
