/[gnulib]/gnulib/lib/mktime.c
ViewVC logotype

Diff of /gnulib/lib/mktime.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.35 by karl, Fri May 30 15:06:41 2003 UTC revision 1.36 by eggert, Wed Jun 4 20:09:48 2003 UTC
# Line 1  Line 1 
1  /* Convert a `struct tm' to a time_t value.  /* Convert a `struct tm' to a time_t value.
2     Copyright (C) 1993-1999, 2002 Free Software Foundation, Inc.     Copyright (C) 1993-1999, 2002, 2003 Free Software Foundation, Inc.
3     This file is part of the GNU C Library.     This file is part of the GNU C Library.
4     Contributed by Paul Eggert (eggert@twinsun.com).     Contributed by Paul Eggert (eggert@twinsun.com).
5    
# Line 264  __mktime_internal (struct tm *tp, Line 264  __mktime_internal (struct tm *tp,
264    
265    int sec_requested = sec;    int sec_requested = sec;
266    
   /* Only years after 1970 are defined.  
      If year is 69, it might still be representable due to  
      timezone differences.  */  
   if (year < 69)  
     return -1;  
   
267  #if LEAP_SECONDS_POSSIBLE  #if LEAP_SECONDS_POSSIBLE
268    /* Handle out-of-range seconds specially,    /* Handle out-of-range seconds specially,
269       since ydhms_tm_diff assumes every minute has 60 seconds.  */       since ydhms_tm_diff assumes every minute has 60 seconds.  */
# Line 377  __mktime_internal (struct tm *tp, Line 371  __mktime_internal (struct tm *tp,
371          return -1;          return -1;
372      }      }
373    
   if (year == 69)  
     {  
       /* If year was 69, need to check whether the time was representable  
          or not.  */  
       if (t < 0 || t > 2 * 24 * 60 * 60)  
         return -1;  
     }  
   
374    *tp = tm;    *tp = tm;
375    return t;    return t;
376  }  }

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26