> > I'm a bit confused about the state of DST handling; there was a patch
> > applied in Debian revision -53, but the patch is large (and combined
> > with other changes) so the (intended) effect of the changes aren't
> > entirely clear to me.  As I recall, that patch also seemed to have
> > been applied in the ISC release.
>
> As I can see here's the openbsd patch included into debian version -53:
> http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/cron/cron.c.diff?r1=1.3&r2=1.4&f=h

> Thanks; my current understanding is that the original patch worked
> when the time was manually changed by 1-3 hours, but didn't work for
> real DST changes (the details aren't clear to me).

I guess you are right.
 
The core change is in set_time routine which
didn't detect DST change before because
time() always returns seconds since epoch.
 
Now they use localtime(), save tm_isdst flag
and check it. When the flag changes -- here comes
the DST change.
 
> BTW, I think there's a new bug here:
> http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/cron/misc.c.diff?r1=1.8&r2=1.11&f=h

We might use the following code to calculate GMT offset
which seems cleaner to me than the original sendmail code
they are using:
 
int get_gmtoff(time_t *clock) {
  struct tm *ps;
  time_t tmp1, tmp2;
  ps = localtime(clock);
  tmp1 = mktime(ps);
  tmp2 = timegm(ps);
  return(tmp2 - tmp1);
}

 
Petya.
 

Reply via email to