Skip to content

Commit

Permalink
dln_find.c: define S_ISREG
Browse files Browse the repository at this point in the history
* dln_find.c (dln_find_1): on some platforms, S_ISREG() is not
  provided.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jan 24, 2015
1 parent 69f47dd commit 10ce32c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dln_find.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 10ce32c

Please sign in to comment.