diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-05-24 15:34:53 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-05-24 15:34:53 +0400 |
commit | 7a3a3f6b38eb5d2ad09997a9fd1aae4bed95fd3a (patch) | |
tree | fe12eb5950d83c5bdefdfbebe563fe4f88102eff | |
parent | 0ee5879fd2673344126089653fe86d0f7ea55625 (diff) | |
download | knot-7a3a3f6b38eb5d2ad09997a9fd1aae4bed95fd3a.tar.gz |
tm_gmtoff may be missed in struct tm
-rw-r--r-- | debian/patches/dyson-tm_gmtoff.patch | 37 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 38 insertions, 0 deletions
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 <time.h>]) ++ + # 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 |