From: Darren Tucker Date: Wed, 7 May 2025 11:05:06 +0000 (+1000) Subject: Skip d_type check on platforms that don't have it. X-Git-Tag: V_10_1_P1~307 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755c3d082e59e6884f28d30e6333a1444e9173d1;p=thirdparty%2Fopenssh-portable.git Skip d_type check on platforms that don't have it. On those, the subsequent stat() should catch the sockets. --- diff --git a/configure.ac b/configure.ac index 221d5f561..98d98594b 100644 --- a/configure.ac +++ b/configure.ac @@ -1700,6 +1700,12 @@ AC_RUN_IFELSE( ] ) +AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [[ +#ifdef HAVE_DIRENT_H +#include +#endif +]]) + AC_MSG_CHECKING([for /proc/pid/fd directory]) if test -d "/proc/$$/fd" ; then AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd]) diff --git a/misc-agent.c b/misc-agent.c index 34ce2a524..db8f93bc8 100644 --- a/misc-agent.c +++ b/misc-agent.c @@ -298,8 +298,10 @@ agent_cleanup_stale(const char *homedir, int ignore_hosthash) goto out; } while ((dp = readdir(d)) != NULL) { +#ifdef HAVE_DIRENT_D_TYPE if (dp->d_type != DT_SOCK && dp->d_type != DT_UNKNOWN) continue; +#endif if (fstatat(dirfd(d), dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 && errno != ENOENT) { error_f("stat \"%s/%s\": %s",