- if (tm != NULL && strftime(buf, 32 /*Magic number*/, "%a %b %d %T %Z %Y", tm) > 0)
- return (StgAddr)buf;
- return (StgAddr)strcpy(buf, "ClockTime.show{LibTime}: internal error");
+#ifdef cygwin32_TARGET_OS
+ /* Same as in timezone.c: tzset() isn't called automatically */
+ tzset();
+#endif
+ if (tm != NULL && strftime(buf, maxsize, "%a %b %d %H:%M:%S %Z %Y", tm) > 0) {
+ return 1;
+ } else {
+ return (-1);
+ }