[dovecot-cvs] dovecot configure.in,1.141,1.142

cras at procontrol.fi cras at procontrol.fi
Sat Aug 2 21:38:17 EEST 2003


Update of /home/cvs/dovecot
In directory danu:/tmp/cvs-serv3979

Modified Files:
	configure.in 
Log Message:
utc_mktime() crashed with 64bit time_t if gmtime() didn't like >32bit values



Index: configure.in
===================================================================
RCS file: /home/cvs/dovecot/configure.in,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- configure.in	27 Jul 2003 05:37:58 -0000	1.141
+++ configure.in	2 Aug 2003 17:38:15 -0000	1.142
@@ -1,7 +1,7 @@
 AC_INIT(src)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(dovecot, 0.99.10)
+AM_INIT_AUTOMAKE(dovecot, 0.99.11-test4)
 
 AM_MAINTAINER_MODE
 
@@ -535,6 +535,41 @@
 	AC_DEFINE(HAVE_TM_GMTOFF,, Define if you have struct tm->tm_gmtoff)
 fi
 AC_MSG_RESULT($i_cv_field_tm_gmtoff)
+
+dnl * how large time_t values does gmtime() accept?
+AC_MSG_CHECKING([how large time_t values gmtime() accepts])
+AC_TRY_RUN([
+  #include <stdio.h>
+  #include <time.h>
+  int main() {
+    FILE *f;
+    int bits;
+    time_t t;
+
+    for (bits = 1, t = 1; t > 0; ++bits, t <<= 1) {
+      if (gmtime(&t) == NULL) {
+        bits--;
+	break;
+      }
+    }
+    f = fopen("conftest.temp", "w");
+    if (f == NULL) {
+      perror("fopen()");
+      return 1;
+    }
+    fprintf(f, "%d", bits);
+    fclose(f);
+    return 0;
+  }
+], [
+  max_bits=`cat conftest.temp`
+  rm -f conftest.temp
+  AC_MSG_RESULT($max_bits)
+], [
+  AC_MSG_RESULT([check failed, assuming 31])
+  max_bits=31
+])
+AC_DEFINE_UNQUOTED(TIME_T_MAX_BITS, $max_bits, max. time_t bits gmtime() can handle)
 
 dnl * do we have struct iovec
 AC_MSG_CHECKING([for struct iovec])



More information about the dovecot-cvs mailing list