(rpl_gmtime): New function. Suggestion from Paul Eggert.
/* Disable the definitions of these functions (from config.h)
so we can use the library versions here. */
#undef gettimeofday
+#undef gmtime
#undef localtime
#undef tzset
return tm;
}
+/* Same as above, since gmtime and localtime use the same buffer. */
+struct tm *
+rpl_gmtime (const time_t *timep)
+{
+ struct tm *tm = gmtime (timep);
+
+ if (! localtime_buffer_addr)
+ localtime_buffer_addr = tm;
+
+ return tm;
+}
+
/* This is a wrapper for gettimeofday. It is used only on systems for which
gettimeofday clobbers the static buffer used for localtime's result.