summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2020-11-21 12:22:23 +0000
committerDarren Tucker <dtucker@dtucker.net>2021-02-05 17:07:03 +1100
commit1cb6ce98d658e5fbdae025a3bd65793980e3b5d9 (patch)
tree04ec22f4b639097546dee9c90fd66f1e815ef391
parent2e0beff67def2120f4b051b1016d7fbf84823e78 (diff)
Using explicit_memset for the explicit_bzero compatibility layer.
Favoriting the native implementation in this case.
-rw-r--r--configure.ac1
-rw-r--r--openbsd-compat/explicit_bzero.c10
2 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 0cd1025f..63c239e0 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 6ef9825a..68cd2c10 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)