From 1cb6ce98d658e5fbdae025a3bd65793980e3b5d9 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 21 Nov 2020 12:22:23 +0000 Subject: [PATCH] Using explicit_memset for the explicit_bzero compatibility layer. Favoriting the native implementation in this case. --- configure.ac | 1 + openbsd-compat/explicit_bzero.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0cd1025f6..63c239e09 100644 --- a/configure.ac +++ b/configure.ac @@ -1805,6 +1805,7 @@ AC_CHECK_FUNCS([ \ err \ errx \ explicit_bzero \ + explicit_memset \ fchmod \ fchmodat \ fchown \ diff --git a/openbsd-compat/explicit_bzero.c b/openbsd-compat/explicit_bzero.c index 6ef9825a9..68cd2c10b 100644 --- a/openbsd-compat/explicit_bzero.c +++ b/openbsd-compat/explicit_bzero.c @@ -15,7 +15,15 @@ #ifndef HAVE_EXPLICIT_BZERO -#ifdef HAVE_MEMSET_S +#ifdef HAVE_EXPLICIT_MEMSET + +void +explicit_bzero(void *p, size_t n) +{ + (void)explicit_memset(p, 0, n); +} + +#elif defined(HAVE_MEMSET_S) void explicit_bzero(void *p, size_t n)