]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix bug #175.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 May 2008 09:00:56 +0000 (09:00 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 May 2008 09:00:56 +0000 (09:00 +0000)
git-svn-id: file:///svn/unbound/trunk@1090 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
daemon/daemon.c
doc/Changelog

index 419f9d80143c18f2b88c96465b60ed0f4ce8a051..731659c0f86392118bba8931f154b958aceaa967 100644 (file)
 /* Define to 1 if you have the <time.h> header file. */
 #undef HAVE_TIME_H
 
+/* Define to 1 if you have the `tzset' function. */
+#undef HAVE_TZSET
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
index 8cd8af4f77eb8a6cf0a9cae6c847a4a5f05db6f4..51a3406c3cbd3e20ef76654c736a1210923ddf91 100755 (executable)
--- a/configure
+++ b/configure
@@ -24982,6 +24982,100 @@ done
 
 
 
+for ac_func in tzset
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 
 for ac_func in getaddrinfo
 do
index fa226706d3b54bc27bcf1d3cb2a2fcf845676ed3..4bc55b501101fbdba9b354e5b5acf1eec9af97ba 100644 (file)
@@ -671,6 +671,7 @@ AC_REPLACE_FUNCS(inet_ntop)
 AC_REPLACE_FUNCS(snprintf)
 AC_REPLACE_FUNCS(strlcpy)
 AC_REPLACE_FUNCS(memmove)
+AC_CHECK_FUNCS([tzset])
 
 AC_CHECK_FUNCS([getaddrinfo])
 if test $ac_cv_func_getaddrinfo = no; then
index 48751364a1cee3a8760743022207f6ca2b6a2342..a31cede9122bdbbb16d0de17f560530ef2bd4a43 100644 (file)
@@ -130,6 +130,10 @@ daemon_init()
        signal_handling_record();
        checklock_start();
        ERR_load_crypto_strings();
+#ifdef HAVE_TZSET
+       /* init timezone info while we are not chrooted yet */
+       tzset();
+#endif
        daemon->need_to_exit = 0;
        modstack_init(&daemon->mods);
        if(!(daemon->env = (struct module_env*)calloc(1, 
index 28c75eedac65b32efcae4a000791ab022015b187..3e29ea2112dba6fcc2174c7a966ec422ecb44d31 100644 (file)
@@ -1,5 +1,7 @@
 22 May 2008: Wouter
        - contrib unbound.spec from Patrick Vande Walle.
+       - fixup bug#175: call tzset before chroot to have correct timestamps
+         in system log.
 
 19 May 2008: Wouter
        - fedora 9, check in6_pktinfo define in configure.