From: Darren Tucker Date: Fri, 5 Sep 2025 11:32:30 +0000 (+1000) Subject: Check for nlist function. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ca274e44cb2c2351376fc14e4c3e92ba4a8f87b;p=thirdparty%2Fopenssh-portable.git Check for nlist function. Check for nlist function presence before attenmpting to use it instead of relying on the presence of the nlist.h header. Mac OS X, in particular has the header, but only has the function in the 32bit libraries. --- diff --git a/configure.ac b/configure.ac index c6cc57f25..df3869324 100644 --- a/configure.ac +++ b/configure.ac @@ -2104,6 +2104,7 @@ AC_CHECK_FUNCS([ \ memset_s \ mkdtemp \ ngetaddrinfo \ + nlist \ nsleep \ ogetaddrinfo \ openlog_r \ diff --git a/misc.c b/misc.c index cb061d4e1..922f04606 100644 --- a/misc.c +++ b/misc.c @@ -3063,7 +3063,7 @@ ptimeout_isset(struct timespec *pt) int lib_contains_symbol(const char *path, const char *s) { -#ifdef HAVE_NLIST_H +#ifdef HAVE_NLIST struct nlist nl[2]; int ret = -1, r; @@ -3083,7 +3083,7 @@ lib_contains_symbol(const char *path, const char *s) out: free(nl[0].n_name); return ret; -#else /* HAVE_NLIST_H */ +#else /* HAVE_NLIST */ int fd, ret = -1; struct stat st; void *m = NULL; @@ -3125,7 +3125,7 @@ lib_contains_symbol(const char *path, const char *s) munmap(m, sz); close(fd); return ret; -#endif /* HAVE_NLIST_H */ +#endif /* HAVE_NLIST */ } int