Skip to content

Commit 755c3d0

Browse files
committed
Skip d_type check on platforms that don't have it.
On those, the subsequent stat() should catch the sockets.
1 parent 207289a commit 755c3d0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

configure.ac

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,12 @@ AC_RUN_IFELSE(
17001700
]
17011701
)
17021702

1703+
AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [[
1704+
#ifdef HAVE_DIRENT_H
1705+
#include <dirent.h>
1706+
#endif
1707+
]])
1708+
17031709
AC_MSG_CHECKING([for /proc/pid/fd directory])
17041710
if test -d "/proc/$$/fd" ; then
17051711
AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd])

misc-agent.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,10 @@ agent_cleanup_stale(const char *homedir, int ignore_hosthash)
298298
goto out;
299299
}
300300
while ((dp = readdir(d)) != NULL) {
301+
#ifdef HAVE_DIRENT_D_TYPE
301302
if (dp->d_type != DT_SOCK && dp->d_type != DT_UNKNOWN)
302303
continue;
304+
#endif
303305
if (fstatat(dirfd(d), dp->d_name,
304306
&sb, AT_SYMLINK_NOFOLLOW) != 0 && errno != ENOENT) {
305307
error_f("stat \"%s/%s\": %s",

0 commit comments

Comments
 (0)