X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=ssl.c;h=313174fe60af3ae0694542c9da94a4f0d06fcefb;hp=acd9f903db3c348c2a25d196e8c33c7c751729a4;hb=4a82a20aaf58473942be8abc70b096ade5490269;hpb=b765c85f842fb50171fff08b87e6b0400559a476 diff --git a/ssl.c b/ssl.c index acd9f903..313174fe 100644 --- a/ssl.c +++ b/ssl.c @@ -1336,33 +1336,17 @@ static int ssl_certificate_is_invalid(const char *cert_file) static int generate_certificate_valid_date(time_t time_spec, char *buffer, size_t buffer_size) { -#ifdef HAVE_GMTIME_R struct tm valid_date; -#endif struct tm *timeptr; size_t ret; -#ifdef HAVE_GMTIME_R - timeptr = gmtime_r(&time_spec, &valid_date); -#elif defined(MUTEX_LOCKS_AVAILABLE) - privoxy_mutex_lock(&gmtime_mutex); - timeptr = gmtime(&time_spec); -#else -#warning Using unlocked gmtime() - timeptr = gmtime(&time_spec); -#endif + timeptr = privoxy_gmtime_r(&time_spec, &valid_date); if (NULL == timeptr) { -#if !defined(HAVE_GMTIME_R) && defined(MUTEX_LOCKS_AVAILABLE) - privoxy_mutex_unlock(&gmtime_mutex); -#endif return 1; } ret = strftime(buffer, buffer_size, "%Y%m%d%H%M%S", timeptr); -#if !defined(HAVE_GMTIME_R) && defined(MUTEX_LOCKS_AVAILABLE) - privoxy_mutex_unlock(&gmtime_mutex); -#endif if (ret != 14) { return 1;