]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
* Check for setrlimit separate from getrlimit.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 5 Jul 2010 14:20:24 +0000 (14:20 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 5 Jul 2010 14:20:24 +0000 (14:20 +0000)
* include sys/time.h for struct timeval definition
* cast for printf, on Minix.

git-svn-id: file:///svn/unbound/trunk@2177 be551aaa-1e26-0410-a405-d3ace91eadb9

configure.ac
daemon/unbound.c
util/storage/slabhash.c

index 95d0231ba644ef63157df1043c2bc5af3ac62a75..8d504070b20d0b0cd1e191ab0654905570b291fc 100644 (file)
@@ -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])])
 
index 251057ef5d6155488096d39d500f048e398375ff..1e51c4d490d3dd4a153af7ef36d966ba34483856 100644 (file)
@@ -44,6 +44,7 @@
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif
+#include <sys/time.h>
 #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,
index ac8358a76c9584c396cd64579ddd8cca9719d669..9c0c5071175e707581bb1eca5cd474fec70658ea 100644 (file)
@@ -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; i<sl->size; i++) {
                snprintf(num, sizeof(num), "table %u", (unsigned)i);
                lruhash_status(sl->array[i], num, extended);