From 7a3a3f6b38eb5d2ad09997a9fd1aae4bed95fd3a Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 24 May 2014 15:34:53 +0400 Subject: tm_gmtoff may be missed in struct tm --- debian/patches/dyson-tm_gmtoff.patch | 37 ++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 38 insertions(+) create mode 100644 debian/patches/dyson-tm_gmtoff.patch diff --git a/debian/patches/dyson-tm_gmtoff.patch b/debian/patches/dyson-tm_gmtoff.patch new file mode 100644 index 0000000..1f3f5a5 --- /dev/null +++ b/debian/patches/dyson-tm_gmtoff.patch @@ -0,0 +1,37 @@ +Description: tm_gmtoff may be missed +Index: knot/configure.ac +=================================================================== +--- knot.orig/configure.ac 2014-05-24 14:03:58.107975376 +0400 ++++ knot/configure.ac 2014-05-24 14:45:02.032197698 +0400 +@@ -324,6 +324,8 @@ + AC_TYPE_SIZE_T + AC_TYPE_SSIZE_T + ++AC_CHECK_MEMBERS([struct tm.tm_gmtoff], [], [], [#include ]) ++ + # Checks for library functions. + AC_CHECK_FUNCS([clock_gettime gettimeofday fgetln getline madvise malloc_trim poll posix_memalign pselect pthread_setaffinity_np regcomp select setgroups initgroups]) + +Index: knot/src/common/log.c +=================================================================== +--- knot.orig/src/common/log.c 2014-05-24 14:03:58.202982325 +0400 ++++ knot/src/common/log.c 2014-05-24 15:03:02.507965836 +0400 +@@ -216,7 +216,9 @@ + struct timeval tv; + gettimeofday(&tv, NULL); + time_t sec = tv.tv_sec; +- if (localtime_r(&sec, <) != NULL) { ++ struct tm *r = localtime_r(&sec, <); ++#ifdef HAVE_STRUCT_TM_TM_GMTOFF ++ if (r) { + bool precise = false; + + #ifdef ENABLE_MICROSECONDS_LOG +@@ -234,6 +236,7 @@ + (unsigned int)(lt.tm_gmtoff / 60) % 60); + } + } ++#endif /* HAVE_STRUCT_TM_TM_GMTOFF */ + + // Log streams + for (int i = LOGT_STDERR; i < LOGT_FILE + LOG_FDS_OPEN; ++i) { diff --git a/debian/patches/series b/debian/patches/series index 777cfd8..50fb5c3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ dyson-s_addr.patch +dyson-tm_gmtoff.patch 0001-loosen-openssl-dependency.patch -- cgit v1.2.3