From 8ce76f29ab6bc6ea0809c085b4f395373b3cb8d7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 9 Apr 2013 17:59:01 -0700 Subject: Also implement x32 support --- src/map/map.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/map/map.cpp') diff --git a/src/map/map.cpp b/src/map/map.cpp index 4fa56c2..63fc8c9 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -1540,9 +1540,9 @@ void map_close_logfile(void) } static -void map_start_logfile(long suffix) +void map_start_logfile(long index) { - map_logfile_index = suffix >> LOGFILE_SECONDS_PER_CHUNK_SHIFT; + map_logfile_index = index; std::string filename_buf = STRPRINTF( "%s.%ld", @@ -1571,12 +1571,13 @@ void map_log(const_string line) if (!map_logfile) return; - time_t t = time(NULL); + time_t t = TimeT::now(); + long i = t >> LOGFILE_SECONDS_PER_CHUNK_SHIFT; - if ((t >> LOGFILE_SECONDS_PER_CHUNK_SHIFT) != map_logfile_index) + if (i != map_logfile_index) { map_close_logfile(); - map_start_logfile(t); + map_start_logfile(i); } log_with_timestamp(map_logfile, line); -- cgit v1.2.3-70-g09d2