diff options
author | Mikael Hallendal <micke@imendio.com> | 2008-10-26 14:45:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-10-26 14:45:26 +0100 |
commit | 29be90b7037fd8d802902573bc5f0f71f4ef40fe (patch) | |
tree | 8b3fc4e990e08d3294b7ac8f1059d40131ebbd91 /libasyncns/asyncns.c | |
parent | 103cafda90765f9a9c09d2898d3fc8982f7e6ce3 (diff) |
Patch for asyncns.c on Mac OS X
Hi Lennart,
I have a copy of libasyncns in Loudmouth and just updated it to the
version in 0.6 which required the following patch in order to build on
Mac OS X.
* arpa/nameser_compat.h seems to get included by nameser.h on Linux but
not on Mac OS X.
* Removed an unused variable that caused the compiler to complain when
building with warnings
* Both Mac OS X and Linux seems to define NSIG (on Linux to _NSIG and on
Mac OS X to __DARWIN_NSIG.
Thanks for your nice work on the lib and hope the patch may be of some
use.
Cheers,
Micke
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Diffstat (limited to 'libasyncns/asyncns.c')
-rw-r--r-- | libasyncns/asyncns.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libasyncns/asyncns.c b/libasyncns/asyncns.c index 3fc737f..054faa3 100644 --- a/libasyncns/asyncns.c +++ b/libasyncns/asyncns.c @@ -41,6 +41,10 @@ #include <resolv.h> #include <dirent.h> +#if HAVE_ARPA_NAMESER_COMPAT_H +#include <arpa/nameser_compat.h> +#endif + #ifdef HAVE_SYS_PRCTL_H #include <sys/prctl.h> #endif @@ -201,7 +205,6 @@ static char *strndup(const char *s, size_t l) { static int close_allv(const int except_fds[]) { struct rlimit rl; int fd; - int saved_errno; #ifdef __linux__ @@ -255,6 +258,8 @@ static int close_allv(const int except_fds[]) { continue; if (close(fd) < 0) { + int saved_errno; + saved_errno = errno; closedir(d); errno = saved_errno; @@ -293,7 +298,7 @@ static int reset_sigsv(const int except[]) { int sig; assert(except); - for (sig = 1; sig < _NSIG; sig++) { + for (sig = 1; sig < NSIG; sig++) { int reset = 1; switch (sig) { |