From: Jim Meyering Date: Wed, 19 Mar 2003 19:33:12 +0000 (+0000) Subject: DJGPP doesn't have S_ISLNK, so provide a replacement. X-Git-Tag: v4.5.11~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8e3afa388395a1c4140de682e0c8fd78497876a;p=thirdparty%2Fcoreutils.git DJGPP doesn't have S_ISLNK, so provide a replacement. (S_IFMT): Define, if necessary. [STAT_MACROS_BROKEN]: Undefine S_ISLNK. (S_ISLNK): Define, if necessary. --- diff --git a/lib/ftw.c b/lib/ftw.c index 95d5a1c3d3..39c5f625fe 100644 --- a/lib/ftw.c +++ b/lib/ftw.c @@ -157,6 +157,22 @@ int rpl_lstat (const char *, struct stat *); # define PATH_MAX 1024 #endif +#ifndef S_IFMT +# define S_IFMT 0170000 +#endif + +#if STAT_MACROS_BROKEN +# undef S_ISLNK +#endif + +#ifndef S_ISLNK +# ifdef S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(m) 0 +# endif +#endif + struct dir_data { DIR *stream;