Mush - patch for UTX/32 2.1a

Mike Hoffman mhoffman at infocenter.UUCP
Sat Mar 25 02:08:32 AEST 1989


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 */



More information about the Comp.sources.bugs mailing list