From: Marko Kreen Date: Sat, 6 Dec 2008 23:33:27 +0000 (+0000) Subject: locatime weirdness wasnt windows specific... X-Git-Tag: pgbouncer_1_3_rc1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7df60c2e3ecd37b678f15dcd42e93dcfa7623677;p=pgbouncer locatime weirdness wasnt windows specific... --- diff --git a/src/util.c b/src/util.c index bcc19b6..6d55831 100644 --- a/src/util.c +++ b/src/util.c @@ -70,7 +70,7 @@ static void render_time(char *buf, int max) gettimeofday(&tv, NULL); tm = localtime(&tv.tv_sec); snprintf(buf, max, "%04d-%02d-%02d %02d:%02d:%02d.%03d", - tm->tm_year, tm->tm_mon, tm->tm_mday, + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, (int)(tv.tv_usec / 1000)); } diff --git a/win32/win32support.h b/win32/win32support.h index df00460..3140004 100644 --- a/win32/win32support.h +++ b/win32/win32support.h @@ -238,17 +238,6 @@ struct passwd { }; static inline const struct passwd * getpwnam(const char *u) { return NULL; } -/* fix localtime */ -static inline struct tm *w_localtime(const time_t *timep) { - struct tm *res = localtime(timep); - if (res) { - res->tm_year += 1900; - res->tm_mon += 1; - } - return res; -} -#define localtime(a) w_localtime(a) - /* * fcntl */