[or-cvs] r18236: {tor} Backport the trivial parts of r18234, especially the one tha (in tor/branches/tor-0_2_0-patches: . src/common src/or)

nickm at seul.org nickm at seul.org
Thu Jan 22 16:37:09 UTC 2009


Author: nickm
Date: 2009-01-22 11:37:09 -0500 (Thu, 22 Jan 2009)
New Revision: 18236

Modified:
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/common/torint.h
   tor/branches/tor-0_2_0-patches/src/common/util.c
   tor/branches/tor-0_2_0-patches/src/or/circuituse.c
   tor/branches/tor-0_2_0-patches/src/or/main.c
Log:
Backport the trivial parts of r18234, especially the one that makes compilation not fail on dev netbsd.

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2009-01-22 16:37:06 UTC (rev 18235)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2009-01-22 16:37:09 UTC (rev 18236)
@@ -1,3 +1,9 @@
+Changes in version 0.2.0.34 - 2009-??-??
+  o Minor bugfixes:
+    - Fix compilation on systems where time-t is a 64-bit integer.
+      Patch from Matthias Drochner.
+
+
 Changes in version 0.2.0.33 - 2009-01-21
   o Security fixes:
     - Fix a heap-corruption bug that may be remotely triggerable on

Modified: tor/branches/tor-0_2_0-patches/src/common/torint.h
===================================================================
--- tor/branches/tor-0_2_0-patches/src/common/torint.h	2009-01-22 16:37:06 UTC (rev 18235)
+++ tor/branches/tor-0_2_0-patches/src/common/torint.h	2009-01-22 16:37:09 UTC (rev 18236)
@@ -290,6 +290,8 @@
 #define TIME_MAX ((time_t)INT_MAX)
 #elif (SIZEOF_TIME_T == SIZEOF_LONG)
 #define TIME_MAX ((time_t)LONG_MAX)
+#elif (SIZEOF_TIME_T == 8)
+#define TIME_MAX ((time_t)INT64_MAX)
 #else
 #error "Can't define (signed) TIME_MAX"
 #endif

Modified: tor/branches/tor-0_2_0-patches/src/common/util.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/common/util.c	2009-01-22 16:37:06 UTC (rev 18235)
+++ tor/branches/tor-0_2_0-patches/src/common/util.c	2009-01-22 16:37:09 UTC (rev 18236)
@@ -1011,7 +1011,7 @@
   hours = days*24 + tm->tm_hour;
 
   minutes = hours*60 + tm->tm_min;
-  ret = minutes*60 + tm->tm_sec;
+  ret = ((time_t)minutes)*60 + tm->tm_sec;
   return ret;
 }
 

Modified: tor/branches/tor-0_2_0-patches/src/or/circuituse.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/circuituse.c	2009-01-22 16:37:06 UTC (rev 18235)
+++ tor/branches/tor-0_2_0-patches/src/or/circuituse.c	2009-01-22 16:37:09 UTC (rev 18236)
@@ -472,7 +472,7 @@
 void
 circuit_build_needed_circs(time_t now)
 {
-  static long time_to_new_circuit = 0;
+  static time_t time_to_new_circuit = 0;
   or_options_t *options = get_options();
 
   /* launch a new circ for any pending streams that need one */

Modified: tor/branches/tor-0_2_0-patches/src/or/main.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/main.c	2009-01-22 16:37:06 UTC (rev 18235)
+++ tor/branches/tor-0_2_0-patches/src/or/main.c	2009-01-22 16:37:09 UTC (rev 18236)
@@ -1178,7 +1178,7 @@
    * could use libevent's timers for this rather than checking the current
    * time against a bunch of timeouts every second. */
   static struct timeval one_second;
-  static long current_second = 0;
+  static time_t current_second = 0;
   struct timeval now;
   size_t bytes_written;
   size_t bytes_read;



More information about the tor-commits mailing list