summaryrefslogtreecommitdiff
path: root/usr.sbin/unbound/ldns/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/unbound/ldns/util.c')
-rw-r--r--usr.sbin/unbound/ldns/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/unbound/ldns/util.c b/usr.sbin/unbound/ldns/util.c
index a7ab96080ce..f5462c4b08f 100644
--- a/usr.sbin/unbound/ldns/util.c
+++ b/usr.sbin/unbound/ldns/util.c
@@ -227,7 +227,7 @@ leap_days(int y1, int y2)
* Code adapted from Python 2.4.1 sources (Lib/calendar.py).
*/
time_t
-mktime_from_utc(const struct tm *tm)
+ldns_mktime_from_utc(const struct tm *tm)
{
int year = 1900 + tm->tm_year;
time_t days = 365 * ((time_t) year - 1970) + leap_days(1970, year);
@@ -251,6 +251,12 @@ mktime_from_utc(const struct tm *tm)
return seconds;
}
+time_t
+mktime_from_utc(const struct tm *tm)
+{
+ return ldns_mktime_from_utc(tm);
+}
+
#if SIZEOF_TIME_T <= 4
static void
@@ -398,6 +404,7 @@ ldns_init_random(FILE *fd, unsigned int size)
if (read < size) {
LDNS_FREE(seed);
+ if (!fd) fclose(rand_f);
return 1;
} else {
#ifdef HAVE_SSL