]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Check for nlist function.
authorDarren Tucker <dtucker@dtucker.net>
Fri, 5 Sep 2025 11:32:30 +0000 (21:32 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 5 Sep 2025 11:32:30 +0000 (21:32 +1000)
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.

configure.ac
misc.c

index c6cc57f252cef015fd5d472d03bf0a70d49c0299..df3869324bbd1b63db491e19e5561c4ee33df786 100644 (file)
@@ -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 cb061d4e1ba8242a9f6c12048752692900c85bf7..922f04606038043667a19009f1a84c29ce8d144a 100644 (file)
--- 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