[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Weird time-zone oscillation



On Sun, Dec 13, 2009 at 01:47:08PM -0600, Kumar Appaiah wrote:
> > If that doesn't help, try posix-in-loop test from single-user mode. Make  
> > sure no other processes are running.
> 
> I've checked, and the same thing happens.
> 
> > I'm not aware of any configuration which could cause this (except for TZ  
> > and /etc/timezone, of course).
> 
> I think I've wasted enough of my time and the list's time on this;
> I'll just go back to work now, and, later, when I get the time and
> enthusiasm, try to hunt this down.
> 
> I really appreciate your help; I'll let you know if and when I get to
> the bottom of this.

OK, there's a bug in your program:

#include <stdio.h>
#include <time.h>

int main(void) {
	char *iso_date = "2009-12-11T2:50:00";
	struct tm tm; /* <- NOT INITIALIZED! */
	time_t time;

	strptime(iso_date, "%FT%T", &tm);
	time = mktime(&tm);
	printf("%ld\t%d\n", time, tm.tm_isdst);
	return 0;
}

If I 	memset(&tm, 0, sizeof(struct tm));, the bug goes away.

Here's the deal: The same bug exists glib. No wonder! The maintainer
of alarm-clock helped me figure that out, and will reassign the bug to
glib (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558099 )

Thanks, all, for helping me. Sorry for wasting your time.

Kumar
-- 
[...] or some clown changed the chips on a board and not its name.
(Don't laugh!  Look at the SMC etherpower for that.)
		-- from /usr/src/linux/MAINTAINERS

Attachment: signature.asc
Description: Digital signature


Reply to: