From: deraadt Date: Sun, 20 Apr 2014 14:14:52 +0000 (+0000) Subject: gettimeofday() is portable enough and does not need a wrapper X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=33e311cf613bdb37bf3b717c434888c1e4487910;p=openbsd gettimeofday() is portable enough and does not need a wrapper --- diff --git a/lib/libssl/d1_lib.c b/lib/libssl/d1_lib.c index 1dc0efc29ca..b6b765634da 100644 --- a/lib/libssl/d1_lib.c +++ b/lib/libssl/d1_lib.c @@ -66,7 +66,6 @@ #include #include "ssl_locl.h" -static void get_current_time(struct timeval *t); const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; int dtls1_listen(SSL *s, struct sockaddr *client); @@ -307,7 +306,7 @@ dtls1_start_timer(SSL *s) } /* Set timeout to current time */ - get_current_time(&(s->d1->next_timeout)); + gettimeofday(&(s->d1->next_timeout), NULL); /* Add duration to current time */ s->d1->next_timeout.tv_sec += s->d1->timeout_duration; @@ -324,7 +323,7 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) { } /* Get current time */ - get_current_time(&timenow); + gettimeofday(&timenow, NULL); /* If timer already expired, set remaining time to 0 */ if (s->d1->next_timeout.tv_sec < timenow.tv_sec || @@ -437,12 +436,6 @@ dtls1_handle_timeout(SSL *s) return dtls1_retransmit_buffered_messages(s); } -static void -get_current_time(struct timeval *t) -{ - gettimeofday(t, NULL); -} - int dtls1_listen(SSL *s, struct sockaddr *client) { diff --git a/lib/libssl/src/ssl/d1_lib.c b/lib/libssl/src/ssl/d1_lib.c index 1dc0efc29ca..b6b765634da 100644 --- a/lib/libssl/src/ssl/d1_lib.c +++ b/lib/libssl/src/ssl/d1_lib.c @@ -66,7 +66,6 @@ #include #include "ssl_locl.h" -static void get_current_time(struct timeval *t); const char dtls1_version_str[]="DTLSv1" OPENSSL_VERSION_PTEXT; int dtls1_listen(SSL *s, struct sockaddr *client); @@ -307,7 +306,7 @@ dtls1_start_timer(SSL *s) } /* Set timeout to current time */ - get_current_time(&(s->d1->next_timeout)); + gettimeofday(&(s->d1->next_timeout), NULL); /* Add duration to current time */ s->d1->next_timeout.tv_sec += s->d1->timeout_duration; @@ -324,7 +323,7 @@ dtls1_get_timeout(SSL *s, struct timeval* timeleft) { } /* Get current time */ - get_current_time(&timenow); + gettimeofday(&timenow, NULL); /* If timer already expired, set remaining time to 0 */ if (s->d1->next_timeout.tv_sec < timenow.tv_sec || @@ -437,12 +436,6 @@ dtls1_handle_timeout(SSL *s) return dtls1_retransmit_buffered_messages(s); } -static void -get_current_time(struct timeval *t) -{ - gettimeofday(t, NULL); -} - int dtls1_listen(SSL *s, struct sockaddr *client) {