+2008-11-18 Dan Fandrich <dan@coneharvesters.com>
+
+ * libexif/exif-entry.c & configure.ac: use localtime_r when available
+ to be more thread safe
+
2008-11-06 Dan Fandrich <dan@coneharvesters.com>
* Released 0.6.17
dnl ---------------------------------------------------------------------------
+dnl Thread-safe functions
+dnl ---------------------------------------------------------------------------
+AC_CHECK_FUNCS(localtime_r)
+
+dnl ---------------------------------------------------------------------------
dnl Compiler/Linker Options and Warnings
dnl ---------------------------------------------------------------------------
AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)"
void
exif_entry_initialize (ExifEntry *e, ExifTag tag)
{
- time_t t;
- struct tm *tm;
ExifRational r;
ExifByteOrder o;
case EXIF_TAG_DATE_TIME:
case EXIF_TAG_DATE_TIME_ORIGINAL:
case EXIF_TAG_DATE_TIME_DIGITIZED:
+ {
+ time_t t;
+ struct tm tms;
+ struct tm *tm;
+
t = time (NULL);
+#ifdef HAVE_LOCALTIME_R
+ tm = localtime_r (&t, &tms);
+#else
tm = localtime (&t);
+#endif
e->components = 20;
e->format = EXIF_FORMAT_ASCII;
e->size = exif_format_get_size (e->format) * e->components;
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
break;
+ }
/* ASCII, no default */
case EXIF_TAG_SUB_SEC_TIME: