[openssh-commits] [openssh] 02/02: Hook memmem compat code into build.

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Jul 16 09:23:16 AEST 2019


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

dtucker pushed a commit to branch master
in repository openssh.

commit 45478898f9590b5cc8bc7104e573b84be67443b0
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Tue Jul 16 09:20:23 2019 +1000

    Hook memmem compat code into build.
    
    This fixes builds on platforms that don't have it (at least old DragonFly,
    probably others).
---
 configure.ac                    | 1 +
 openbsd-compat/Makefile.in      | 1 +
 openbsd-compat/memmem.c         | 5 +++++
 openbsd-compat/openbsd-compat.h | 4 ++++
 4 files changed, 11 insertions(+)

diff --git a/configure.ac b/configure.ac
index 958e99fd..63e01773 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1751,6 +1751,7 @@ AC_CHECK_FUNCS([ \
 	llabs \
 	login_getcapbool \
 	md5_crypt \
+	memmem \
 	memmove \
 	memset_s \
 	mkdtemp \
diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in
index 2cc34363..1162dc55 100644
--- a/openbsd-compat/Makefile.in
+++ b/openbsd-compat/Makefile.in
@@ -34,6 +34,7 @@ OPENBSD=base64.o \
 	inet_ntoa.o \
 	inet_ntop.o \
 	md5.o \
+	memmem.o \
 	mktemp.o \
 	pwcache.o \
 	readpassphrase.o \
diff --git a/openbsd-compat/memmem.c b/openbsd-compat/memmem.c
index 823443b0..3e5e6b5e 100644
--- a/openbsd-compat/memmem.c
+++ b/openbsd-compat/memmem.c
@@ -27,6 +27,10 @@
  * SUCH DAMAGE.
  */
 
+#include "includes.h"
+
+#ifndef HAVE_MEMMEM
+
 #include <string.h>
 
 /*
@@ -62,3 +66,4 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
 	return NULL;
 }
 DEF_WEAK(memmem);
+#endif /* HAVE_MEMMEM */
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 86d45317..fda6706f 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -73,6 +73,10 @@ int getpagesize(void);
 char *getcwd(char *pt, size_t size);
 #endif
 
+#ifdef HAVE_MEMMEM
+void *memmem(const void *, size_t, const void *, size_t);
+#endif
+
 #ifndef HAVE_REALLOCARRAY
 void *reallocarray(void *, size_t, size_t);
 #endif

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


More information about the openssh-commits mailing list