Hi John,
Is this strictly necessary? Would we be perhaps better off working
around gmtime by using an alternative function all together? Or, if
we do require a compat version, the man page suggests this much
simpler alternative:
> For a portable version of timegm(), set the TZ environment variable to
> UTC, call mktime(3) and restore the value of TZ. Something like
> #include <time.h>
> #include <stdlib.h>
> time_t
> my_timegm(struct tm *tm)
> {
> time_t ret;
> char *tz;
> tz = getenv("TZ");
> setenv("TZ", "", 1);
> tzset();
> ret = mktime(tm);
> if (tz)
> setenv("TZ", tz, 1);
> else
> unsetenv("TZ");
> tzset();
> return ret;
> }
This might not be entirely safe, were cgit to ever become
multi-threaded, but it's certainly a lot simpler than rolling our own.
Jason
_______________________________________________
cgit mailing list
[email protected]
http://hjemli.net/mailman/listinfo/cgit