apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: apr/time/unix time.c
Date Thu, 10 Jan 2002 23:46:43 GMT
jerenkrantz    02/01/10 15:46:43

  Modified:    .        CHANGES
               time/unix time.c
  Log:
  Fix GMT offset calculations for platforms that do not have native GMT
  offsets.
  Submitted by:	Jon Travis <jtravis@covalent.net>
  Reviewed by:	Justin, Brian, David
  
  Revision  Changes    Path
  1.204     +3 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.203
  retrieving revision 1.204
  diff -u -r1.203 -r1.204
  --- CHANGES	10 Jan 2002 01:19:24 -0000	1.203
  +++ CHANGES	10 Jan 2002 23:46:43 -0000	1.204
  @@ -1,5 +1,8 @@
   Changes with APR b1  
   
  +  *) Fix GMT offset adjustments for platforms that do not have native
  +     GMT offset adjustments.  [Jon Travis <jtravis@covalent.net>]
  +
     *) Add new apr_shm_t API and remove old apr_shmem_t API. The new
        API handles both anonymous and name-based shared memory. Anonymous
        shared memory segments are only usable on systems with process
  
  
  
  1.59      +4 -3      apr/time/unix/time.c
  
  Index: time.c
  ===================================================================
  RCS file: /home/cvs/apr/time/unix/time.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- time.c	2 Jan 2002 20:12:34 -0000	1.58
  +++ time.c	10 Jan 2002 23:46:43 -0000	1.59
  @@ -92,6 +92,9 @@
       if (daylightOnOff) {
           return server_gmt_offset + daylightOffset;
       }
  +#else
  +    if(tm->tm_isdst)
  +        return server_gmt_offset + 3600;
   #endif
       return server_gmt_offset;
   #endif
  @@ -341,7 +344,6 @@
       struct timeval now;
       time_t t1, t2;
       struct tm t;
  -    int was_dst;
   
       gettimeofday(&now, NULL);
       t1 = now.tv_sec;
  @@ -352,10 +354,9 @@
   #else
       t = *gmtime(&t1);
   #endif
  -    was_dst = (t.tm_isdst > 0);
       t.tm_isdst = -1;
       t2 = mktime(&t);
  -    server_gmt_offset = (apr_int32_t) difftime(t1, t2) + (was_dst ? 3600 : 0);
  +    server_gmt_offset = (apr_int32_t) difftime(t1, t2);
   #endif
   }
   
  
  
  

Mime
View raw message