mingw lacks localtime_r(); we were getting it from gnulib. But since
commit
acf522e8 stopped linking examples against gnulib, we are
getting a build failure. Keep the examples standalone, and work
around mingw by using the non-reentrant localtime() (safe since our
examples are single-threaded), and add a necessary exemption to our
syntax check.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
^src/rpc/gendispatch\.pl$$
exclude_file_name_regexp--sc_prohibit_nonreentrant = \
- ^((po|tests)/|docs/.*(py|js|html\.in)|run.in$$|tools/wireshark/util/genxdrstub\.pl$$)
+ ^((po|tests|examples/admin)/|docs/.*(py|js|html\.in)|run.in$$|tools/wireshark/util/genxdrstub\.pl$$)
exclude_file_name_regexp--sc_prohibit_select = \
^cfg\.mk$$
{
char *ret = NULL;
struct tm timeinfo;
+ struct tm *timeinfop;
- if (!localtime_r(&then, &timeinfo))
+ /* localtime_r() is smarter, but since mingw lacks it and this
+ * example is single-threaded, we can get away with localtime */
+ if (!(timeinfop = localtime(&then)))
return NULL;
+ timeinfo = *timeinfop;
if (!(ret = calloc(64, sizeof(char))))
return NULL;
{
char *ret = NULL;
struct tm timeinfo;
+ struct tm *timeinfop;
- if (!localtime_r(&then, &timeinfo))
+ /* localtime_r() is smarter, but since mingw lacks it and this
+ * example is single-threaded, we can get away with localtime */
+ if (!(timeinfop = localtime(&then)))
return NULL;
+ timeinfo = *timeinfop;
if (!(ret = calloc(64, sizeof(char))))
return NULL;