[openssh-commits] [openssh] 04/04: Add implementation of localtime_r.

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Oct 29 20:49:15 AEDT 2019


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 1bcd1169c5221688418fa38606e9c69055b72451
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Tue Oct 29 19:45:03 2019 +1100

    Add implementation of localtime_r.
---
 configure.ac              |  1 +
 openbsd-compat/bsd-misc.c | 10 ++++++++++
 openbsd-compat/bsd-misc.h |  4 ++++
 3 files changed, 15 insertions(+)

diff --git a/configure.ac b/configure.ac
index ea99887f..9b4a7ee6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1763,6 +1763,7 @@ AC_CHECK_FUNCS([ \
 	inet_ntop \
 	innetgr \
 	llabs \
+	localtime_r \
 	login_getcapbool \
 	md5_crypt \
 	memmem \
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 7a26ee40..829e0c07 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -426,3 +426,13 @@ int _ssh_compat_fflush(FILE *f)
 	return fflush(f);
 }
 #endif
+
+#ifndef HAVE_LOCALTIME_R
+struct tm *
+localtime_r(const time_t *timep, struct tm *result)
+{
+	struct tm *tm = localtime(timep);
+	*result = *tm;
+	return result;
+}
+#endif
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index f5b032bb..5a369d9d 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -178,4 +178,8 @@ int flock(int, int);
 # define fflush(x)	(_ssh_compat_fflush(x))
 #endif
 
+#ifndef HAVE_LOCALTIME_R
+struct tm *localtime_r(const time_t *, struct tm *);
+#endif
+
 #endif /* _BSD_MISC_H */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list