From 7b352458d0f249f4e6b7f92450fce1e5e9b53e79 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 8 Dec 2002 20:51:55 +0000 Subject: (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define to rpl_lstat, so that even on systems like Solaris 5.8, du honors (per POSIX) the trailing slash on an argument referring to a symlink-to-directory. --- src/du.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/du.c') diff --git a/src/du.c b/src/du.c index b5c525810..a4648be67 100644 --- a/src/du.c +++ b/src/du.c @@ -96,6 +96,15 @@ typedef struct String String; int stat (); int lstat (); +/* Arrange to make lstat calls go through the wrapper function + on systems with an lstat function that does not dereference symlinks + that are specified with a trailing slash. */ +#if ! LSTAT_FOLLOWS_SLASHED_SYMLINK +int rpl_lstat (char const *, struct stat *); +# undef lstat +# define lstat rpl_lstat +#endif + /* Name under which this program was invoked. */ char *program_name; -- cgit v1.2.3-54-g00ecf