*/
#include <EUSCompat.h>
+#define XOS_USE_NO_LOCKING
+#define X_INCLUDE_TIME_H
+#include <X11/Xos_r.h>
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
static char tzenv[BUFSIZ];
if (tzname==NULL)
- system("unset TZ\n");
+ (void) putenv("TZ");
else {
snprintf(tzenv, sizeof tzenv, "TZ=%s", tzname);
(void) putenv(tzenv);
- tzset();
}
+ tzset();
}
static int
time_t tk=tick;
char tz_orig[BUFSIZ];
boolean_t orig_tzset = B_FALSE;
+ _Xgtimeparams gmtime_buf;
/* tick must be +ve to be valid */
if (tick < 0) {
return(-1);
}
+ /* JET. This is horrible. */
+#if !defined(linux) && !defined(CSRG_BASED)
+
if (getenv("TZ")) {
strncpy(tz_orig, getenv("TZ"), sizeof(tz_orig));
tz_orig[sizeof(tz_orig)-1] = '\0';
else
set_timezone(NULL);
+#else
+ /* let's use something a little more reasonable */
+ time_str = _XGmtime(&tk, gmtime_buf);
+#endif /* !linux && !CSGRC_BASED */
+
/* format string forces fixed width (zero-padded) fields */
sprintf(buf_out, "%04d%02d%02dT%02d%02d%02dZ",
time_str->tm_year + 1900,