diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-02-22 07:03:03 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-02-22 07:03:03 +0000 |
commit | 70c3580f81dd560072209fe32c740c33d3781c67 (patch) | |
tree | a914e5d669ef9bf6d7b3ed79a07157cd676c9c61 /src/common/tortls.c | |
parent | d01718841e5bc3d365191e74bebbccee48c8b045 (diff) | |
download | tor-70c3580f81dd560072209fe32c740c33d3781c67.tar.gz tor-70c3580f81dd560072209fe32c740c33d3781c67.zip |
Patch to localtime/gmtime handling: use the _r variants where available. Use mutexes to fake _r where necessary. Make mutexes no-ops where no threading is enabled.
svn:r3653
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 42074cc41a..9f7bf326d9 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -644,6 +644,7 @@ static void log_cert_lifetime(X509 *cert, const char *problem) char *s1=NULL, *s2=NULL; char mytime[33]; time_t now = time(NULL); + struct tm tm; if (problem) log_fn(LOG_WARN,"Certificate %s: is your system clock set incorrectly?", @@ -667,7 +668,7 @@ static void log_cert_lifetime(X509 *cert, const char *problem) BIO_get_mem_ptr(bio, &buf); s2 = tor_strndup(buf->data, buf->length); - strftime(mytime, 32, "%b %d %H:%M:%S %Y GMT", gmtime(&now)); + strftime(mytime, 32, "%b %d %H:%M:%S %Y GMT", tor_gmtime_r(&now, &tm)); log_fn(LOG_WARN, "(certificate lifetime runs from %s through %s. Your time is %s.)",s1,s2,mytime); |