Bug #514

Linking with libexiv2 masks system localtime, and on MinGW, that of libexiv2 doesn't handle DST correctly

Added by Andreas Huggel about 10 years ago. Updated over 8 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Andreas Huggel% Done:

0%

Category:miscellaneous
Target version:0.16

Description

When using the minGW environment on Windows XP the following code
produces an output of "DST: 1" when daylights savings time is active:

time_t now;
struct tm bdt;

time(&now);
bdt = *localtime(&now);
printf("DST: %d\n",bdt.tm_isdst);

But running the same code while linking with the exiv2 lib, the
output will be "DST: 0", i.e. daylight savings time is off (not
unknown which would result in -1).

Is there any way to get around this behavior so that my software
can get a correct reading on whether DST is active or not?

Additional information:

If I comment out the localtime function in localtime.c that comes
with the exiv2 package, the "isdst" variable will be set correctly
(just as when exiv2 is not linked with the application). Commenting
out the code is, however, not a very nice solution since I'd have to
do that if I upgrade exiv2 in the future, and it will make it
difficult for anyone else who wants to build the code.

So, is there a way to make sure that the original localtime is used
when linking with exiv2, or is there a bug in the exiv2 localtime
that can be fixed in future versions?


Related issues

Related to Exiv2 - Bug #484: exiv2 -T adjusts file timestamp wrongly Closed

History

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux