lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If you carefully read the following discussion: http://stackoverflow.com/questions/19170721/real-time-awareness-of-timezone-change-in-localtime-vs-localtime-r , you will notice that my bug report is *only POSIX* related. This pary of Lua code is the problem:

/*
** By default, Lua uses gmtime/localtime, except when POSIX is available,
** where it uses gmtime_r/localtime_r
*/
#if defined(LUA_USE_GMTIME_R)

#define l_gmtime(t,r) gmtime_r(t,r)
#define l_localtime(t,r) localtime_r(t,r)

#elif !defined(l_gmtime)

#define l_gmtime(t,r) ((void)r, gmtime(t))
#define l_localtime(t,r)   ((void)r, localtime(t))

#endif



2014-10-31 2:15 GMT+01:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
This is not a Lua bug: the same thing will happen in a plain C program.
It does not sound polite for a library function in Lua to call tzset:
that should be the prerogatives of the host program.