diff --git a/configure.ac b/configure.ac index 95d0231ba..8d504070b 100644 --- a/configure.ac +++ b/configure.ac @@ -608,7 +608,7 @@ if test $ac_cv_func_daemon = yes; then fi AC_SEARCH_LIBS([setusercontext], [util]) -AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev glob initgroups strftime localtime_r setusercontext _beginthreadex]) +AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev glob initgroups strftime localtime_r setusercontext _beginthreadex]) AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])]) AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])]) diff --git a/daemon/unbound.c b/daemon/unbound.c index 251057ef5..1e51c4d49 100644 --- a/daemon/unbound.c +++ b/daemon/unbound.c @@ -44,6 +44,7 @@ #ifdef HAVE_GETOPT_H #include #endif +#include #include "util/log.h" #include "daemon/daemon.h" #include "daemon/remote.h" @@ -213,8 +214,12 @@ checkrlimits(struct config_file* cfg) avail = (size_t)rlim.rlim_cur; rlim.rlim_cur = (rlim_t)(total + 10); rlim.rlim_max = (rlim_t)(total + 10); +#ifdef HAVE_SETRLIMIT if(setrlimit(RLIMIT_NOFILE, &rlim) < 0) { log_warn("setrlimit: %s", strerror(errno)); +#else + if(0) { +#endif log_warn("cannot increase max open fds from %u to %u", (unsigned)avail, (unsigned)total+10); /* check that calculation below does not underflow, diff --git a/util/storage/slabhash.c b/util/storage/slabhash.c index ac8358a76..9c0c50711 100644 --- a/util/storage/slabhash.c +++ b/util/storage/slabhash.c @@ -135,7 +135,7 @@ void slabhash_status(struct slabhash* sl, const char* id, int extended) size_t i; char num[17]; log_info("Slabhash %s: %u tables mask=%x shift=%d", - id, (unsigned)sl->size, sl->mask, sl->shift); + id, (unsigned)sl->size, (unsigned)sl->mask, sl->shift); for(i=0; isize; i++) { snprintf(num, sizeof(num), "table %u", (unsigned)i); lruhash_status(sl->array[i], num, extended);