summaryrefslogtreecommitdiff
path: root/dln_find.c
diff options
context:
space:
mode:
Diffstat (limited to 'dln_find.c')
-rw-r--r--dln_find.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dln_find.c b/dln_find.c
index 4e88d4f9cb..bc83b659e9 100644
--- a/dln_find.c
+++ b/dln_find.c
@@ -278,6 +278,9 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
}
#endif /* _WIN32 or __EMX__ */
+#ifndef S_ISREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
if (stat(fbuf, &st) == 0 && S_ISREG(st.st_mode)) {
if (exe_flag == 0) return fbuf;
/* looking for executable */