ARC 5.21 Patch #2 - change tmclock.c

Howard Chu hyc at math.lsa.umich.edu
Wed Aug 3 07:52:35 AEST 1988


Apparently after applying certain patches to the BSD 4.3 ctime() library, the
function timezone() gets declared in such a way as to conflict with any other
global symbols of the same name. (i.e., someone else reported this to me, but
it didn't happen on our 4.3 BSD Vax. Ah well...) Simple change, please apply
it as well. [The ctime changes fixed the handling of daylight savings time. I
guess our approach to the problem was to wait for the time to be correct, and
then voila - no more problem...  }-)  ]
  -- Howard

*** /tmp/,RCSt1a08749	Tue Aug  2 17:44:54 1988
--- tmclock.c	Tue Aug  2 14:17:13 1988
***************
*** 9,15 ****
   *  -- Howard Chu, August 1 1988      hyc at umix.cc.umich.edu, umix!hyc
   */
  
! /* $Header: tmclock.c,v 1.2 88/08/01 14:34:38 hyc Exp $ */
  
  /* Julian day number of the Unix* clock's origin, 01 Jan 1970. */
  #define JD1970 2440587L
--- 9,15 ----
   *  -- Howard Chu, August 1 1988      hyc at umix.cc.umich.edu, umix!hyc
   */
  
! /* $Header: tmclock.c,v 1.3 88/08/02 14:15:58 hyc Exp $ */
  
  /* Julian day number of the Unix* clock's origin, 01 Jan 1970. */
  #define JD1970 2440587L
***************
*** 17,27 ****
  #if	BSD
  #include <sys/time.h>
  int	daylight;
- long	timezone;
  #else
  #include <time.h>
  #endif
  
  long
  tmjuliandate( tm )
  struct tm *tm;
--- 17,28 ----
  #if	BSD
  #include <sys/time.h>
  int	daylight;
  #else
  #include <time.h>
  #endif
  
+ long	tzone;
+ 
  long
  tmjuliandate( tm )
  struct tm *tm;
***************
*** 66,73 ****
  
         gettimeofday(&tp, &tzp);
         daylight=tzp.tz_dsttime;
!        timezone=tzp.tz_minuteswest*(-60);
      }
  #endif
      if ( (sec = tm -> tm_sec) < 0 || sec > 59 ||
  	    (min = tm -> tm_min) < 0 || min > 59 ||
--- 67,76 ----
  
         gettimeofday(&tp, &tzp);
         daylight=tzp.tz_dsttime;
!        tzone=tzp.tz_minuteswest*(-60);
      }
+ #else
+     tzone=timezone;	/* declared as extern in SYSV <time.h> */
  #endif
      if ( (sec = tm -> tm_sec) < 0 || sec > 59 ||
  	    (min = tm -> tm_min) < 0 || min > 59 ||
***************
*** 75,81 ****
  	return ( -1L );
  
      result = ( hour * 60 + min ) * 60 + sec;
!     result -= timezone;
      if ( daylight )
  	result -= 60 * 60;
  
--- 78,84 ----
  	return ( -1L );
  
      result = ( hour * 60 + min ) * 60 + sec;
!     result -= tzone;
      if ( daylight )
  	result -= 60 * 60;
  
--
  /
 /_ , ,_.                      Howard Chu
/ /(_/(__                University of Michigan
    /           Computing Center          College of LS&A
   '              Unix Project          Information Systems



More information about the Comp.sources.bugs mailing list