summaryrefslogtreecommitdiff
path: root/lib/lstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lstat.c')
-rw-r--r--lib/lstat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/lstat.c b/lib/lstat.c
index b26065ede28..29fc6d25f90 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -17,6 +17,10 @@
/* written by Jim Meyering */
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+ the system's <sys/stat.h> here, so that orig_lstat doesn't recurse to
+ rpl_lstat. */
+#define __need_system_sys_stat_h
#include <config.h>
#if !HAVE_LSTAT
@@ -27,7 +31,6 @@ typedef int dummy;
#else /* HAVE_LSTAT */
/* Get the original definition of lstat. It might be defined as a macro. */
-# define __need_system_sys_stat_h
# include <sys/types.h>
# include <sys/stat.h>
# undef __need_system_sys_stat_h