From: Curt M. <we...@us...> - 2005-10-26 01:02:04
|
Update of /cvsroot/xastir/xastir/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8337 Modified Files: util.c Log Message: Fixing the alert expiration problem. May need to be checked when we switch out of daylight savings time again. Index: util.c =================================================================== RCS file: /cvsroot/xastir/xastir/src/util.c,v retrieving revision 1.188 retrieving revision 1.189 diff -C2 -d -r1.188 -r1.189 *** util.c 25 Oct 2005 19:25:42 -0000 1.188 --- util.c 26 Oct 2005 01:01:53 -0000 1.189 *************** *** 1446,1451 **** zone = time_now->tm_gmtoff; //fprintf(stderr,"gmtoff: %ld, tm_isdst: %d\n", ! // time_now->tm_gmtoff, ! // time_now->tm_isdst); #else // HAVE_TM_GMTOFF // Note: timezone is seconds WEST of UTC. Need to negate --- 1446,1451 ---- zone = time_now->tm_gmtoff; //fprintf(stderr,"gmtoff: %ld, tm_isdst: %d\n", ! //time_now->tm_gmtoff, ! //time_now->tm_isdst); #else // HAVE_TM_GMTOFF // Note: timezone is seconds WEST of UTC. Need to negate *************** *** 1453,1458 **** zone = -((int)timezone - 3600 * (int)(time_now->tm_isdst > 0)); //fprintf(stderr,"timezone: %d, tm_isdst: %d\n", ! // timezone, ! // time_now->tm_isdst); #endif // HAVE_TM_GMTOFF // zone should now be the number to subtract in order to get --- 1453,1458 ---- zone = -((int)timezone - 3600 * (int)(time_now->tm_isdst > 0)); //fprintf(stderr,"timezone: %d, tm_isdst: %d\n", ! //timezone, ! //time_now->tm_isdst); #endif // HAVE_TM_GMTOFF // zone should now be the number to subtract in order to get *************** *** 1530,1539 **** // time by using addition (PDT zone = -28800). - //WE7U // Initialize daylight savings time to 0 in this // instance, 'cuz we're starting with Zulu time and we // want the localtime conversion to change it correctly. // Zulu time has no daylight savings time offset. ! alert_time.tm_isdst = 0; --- 1530,1553 ---- // time by using addition (PDT zone = -28800). // Initialize daylight savings time to 0 in this // instance, 'cuz we're starting with Zulu time and we // want the localtime conversion to change it correctly. // Zulu time has no daylight savings time offset. ! // ! // WE7U: ! // No, it gave us an offset of 6 hours from UTC when we set this to ! // zero, 7 hours (correct) when we set it to one, during the summer. ! // Hopefully it will give us an 8-hour offset during the wintertime ! // but that remains to be seen... ! // ! // FYI: We're in daylight savings time during the summer, when ! // we're at a 7-hour offset. Winter is actual time and a -8 hour ! // offset. ! // ! // One on-line resource suggested setting it to -1 for automatic ! // determination of DST. This works too, during the summer. Again, ! // check during the wintertime too when we're at normal time. ! // ! alert_time.tm_isdst = -1; |