Changeset 12644 in project for chicken/trunk/runtime.c


Ignore:
Timestamp:
11/29/08 04:41:31 (12 years ago)
Author:
Kon Lovett
Message:

Make sure tzname, etc. variables are set before use. Doubtful if tzname will be used before a time.h proc is used but to be safe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/runtime.c

    r12631 r12644  
    634634  int i;
    635635
    636 #ifndef C_NONUNIX
     636  /*FIXME Should have C_tzset in chicken.h? */
     637#ifdef C_NONUNIX
     638  C_startup_time_seconds = (time_t)0;
     639# if defined(_MSC_VER) || defined(__MINGW32__)
     640  /* Make sure _tzname, _timezone, and _daylight are set */
     641  _tzset();
     642# elif defined(__WATCOMC__) || defined(__DJGPP__)
     643  /* Make sure tzname, timezone, and daylight are set */
     644  tzset();
     645# endif
     646#else
    637647  struct timeval tv;
    638648  C_gettimeofday(&tv, NULL);
    639649  C_startup_time_seconds = tv.tv_sec;
    640 #else
    641   C_startup_time_seconds = (time_t)0;
     650  /* Make sure tzname, timezone, and daylight are set */
     651  tzset();
    642652#endif
    643653
Note: See TracChangeset for help on using the changeset viewer.