]> granicus.if.org Git - p11-kit/commitdiff
common: Remove compat timegm() implementation
authorStef Walter <stefw@redhat.com>
Mon, 19 Oct 2015 09:33:19 +0000 (11:33 +0200)
committerStef Walter <stefw@redhat.com>
Mon, 19 Oct 2015 09:33:19 +0000 (11:33 +0200)
We no longer use timegm()

common/compat.c
configure.ac

index 768bb7d17874aa43321eac59ff8550c0084d9946..de5b99b6b6fd3c1698a4f569efc82a8c25332b76 100644 (file)
@@ -622,37 +622,6 @@ gmtime_r (const time_t *timep,
 
 #endif /* HAVE_GMTIME_R */
 
-#ifndef HAVE_TIMEGM
-
-time_t
-timegm (struct tm *tm)
-{
-       time_t tl, tb;
-       struct tm tg;
-
-       tl = mktime (tm);
-       if (tl == -1) {
-               tm->tm_hour--;
-               tl = mktime (tm);
-               if (tl == -1)
-                       return -1;
-               tl += 3600;
-       }
-       gmtime_r (&tl, &tg);
-       tg.tm_isdst = 0;
-       tb = mktime (&tg);
-       if (tb == -1) {
-               tg.tm_hour--;
-               tb = mktime (&tg);
-               if (tb == -1)
-                       return -1;
-               tb += 3600;
-       }
-       return (tl - (tb - tl));
-}
-
-#endif /* HAVE_TIMEGM */
-
 #if !defined(HAVE_MKDTEMP) || !defined(HAVE_MKSTEMP)
 #include <sys/stat.h>
 #include <fcntl.h>
index 77bda6a3e7497e10d6e41d0b4b1ef0dac63fcc83..c35304615cf5fe8337136c33ee6ad629a1528072 100644 (file)
@@ -91,7 +91,6 @@ if test "$os_unix" = "yes"; then
        AC_CHECK_FUNCS([getauxval issetugid getresuid secure_getenv])
        AC_CHECK_FUNCS([strnstr memdup strndup strerror_r])
        AC_CHECK_FUNCS([asprintf vasprintf vsnprintf])
-       AC_CHECK_FUNCS([timegm])
        AC_CHECK_FUNCS([fdwalk])
        AC_CHECK_FUNCS([setenv])