--- deliantra/server/common/logger.C 2008/04/15 03:16:02 1.17 +++ deliantra/server/common/logger.C 2008/05/06 16:55:25 1.19 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * @@ -59,16 +59,18 @@ static void log_sync (logline &line) { - struct tm *lt = localtime (&line.tv.tv_sec); + struct tm lt; char pfx [PREFIX_LEN]; + localtime_r (&line.tv.tv_sec, <); + sprintf (pfx, "%04d-%02d-%02d %02d:%02d:%02d.%04d", - lt->tm_year + 1900, - lt->tm_mon + 1, - lt->tm_mday, - lt->tm_hour, - lt->tm_min, - lt->tm_sec, + lt.tm_year + 1900, + lt.tm_mon + 1, + lt.tm_mday, + lt.tm_hour, + lt.tm_min, + lt.tm_sec, (int)(line.tv.tv_usec / 100) );