summaryrefslogtreecommitdiff
path: root/src/du.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-12-08 20:51:55 +0000
committerJim Meyering <jim@meyering.net>2002-12-08 20:51:55 +0000
commit7b352458d0f249f4e6b7f92450fce1e5e9b53e79 (patch)
treeb6e76103e48bf005b0e7d4c12a66381b4ae2ad8f /src/du.c
parentabf1b2450fffda22f64d40689f2bb715e8908b16 (diff)
downloadcoreutils-7b352458d0f249f4e6b7f92450fce1e5e9b53e79.tar.xz
(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.
Diffstat (limited to 'src/du.c')
-rw-r--r--src/du.c9
1 files changed, 9 insertions, 0 deletions
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;