mhoffman@infocenter.UUCP (Mike Hoffman) (03/25/89)
While compiling mush 6.4, I ran across a rather unexpected problem during loading: "_timezone: undefined." Well I tried "man timezone" and got the manpage for ctime(3), but timezone() was missing from the page! Well, we recently upgraded to UTX/32 2.1a, and an older manual from 2.0 (which had timezone) says, "timezone may become unsupported in a future release. Use ... is strongly discouraged." I guess the future is now :-) Anyhow, here is my kludge (I mean fix). Not very scientific, but it seems to work. We are on Eastern Time, but I guess the "EST" and "EDT" could be #define'd to any appropriate timezone. Thanks to Mr. Heller for providing such a great tool! --- Mike Hoffman ...!novavax!gould!mhoffman ------------------------CUT HERE------------------------------ *** dates.orig.c Fri Mar 24 10:45:19 1989 --- dates.c Fri Mar 24 10:52:01 1989 *************** *** 219,225 **** (void) gettimeofday(&mytime, &myzone); T = localtime(&mytime.tv_sec); ! tz = timezone(myzone.tz_minuteswest, (T->tm_isdst && myzone.tz_dsttime)); #else char *tz = ""; #endif /* BSD */ --- 219,230 ---- (void) gettimeofday(&mytime, &myzone); T = localtime(&mytime.tv_sec); ! ! if (T->tm_isdst) ! tz = "EDT"; /* Assume Eastern Time ;-) */ ! else ! tz = "EST"; ! #else char *tz = ""; #endif /* BSD */
wytze@gouldnl.UUCP (Wytze van der Raay) (03/28/89)
In article <1799@infocenter.UUCP> mhoffman@infocenter.UUCP (Mike Hoffman) writes: >While compiling mush 6.4, I ran across a rather unexpected >problem during loading: "_timezone: undefined." Well I tried >"man timezone" and got the manpage for ctime(3), but timezone() >was missing from the page! ... >Anyhow, here is my kludge (I mean fix). Not very scientific, but >it seems to work. We are on Eastern Time, but I guess the "EST" >and "EDT" could be #define'd to any appropriate timezone. The proposed change is really a kludge, not a fix! How about innocent Mush users outside the EST/EDT timezone? You don't really want them to edit the source again and again ... Basically, the code in dates.c::rfc_date needs to be upgraded for the case of a BSD4.3 system which uses the /etc/zoneinfo system for establishing timezones. This includes (as far as Gould is concerned) UTX/32 2.1 and later (PowerNode), and UTX/32 3.0 and later(NPL). The following context diff shows how this can be done. Presumably Dan Heller can turn this into a generic fix for BSD4.3 ++ systems sometime ... *** dates.c.org Thu Mar 16 09:17:47 1989 --- dates.c Tue Mar 28 12:25:07 1989 *************** *** 219,225 **** --- 219,231 ---- (void) gettimeofday(&mytime, &myzone); T = localtime(&mytime.tv_sec); + #if defined(gould) && defined(COFF) + /* Newer BSD4.3 systems use flexible timezone implementation. */ + /* This happens to coincide with the introduction of COFF ... */ + tz = T->tm_zone; + #else tz = timezone(myzone.tz_minuteswest, (T->tm_isdst && myzone.tz_dsttime)); + #endif #else char *tz = ""; #endif /* BSD */ -- | Wytze van der Raay ...!hp4nl!gouldnl!wytze | | Gould European Unix Support Centre wytze@gouldnl.uucp | | Maarssenbroek, The Netherlands (USA) ...!gould!wraay |