diff options
Diffstat (limited to 'lib/lstat.c')
-rw-r--r-- | lib/lstat.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/lstat.c b/lib/lstat.c index 0fc3b2c51..eb57d390f 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 @@ -39,7 +42,10 @@ orig_lstat (const char *filename, struct stat *buf) } /* Specification. */ -# include <sys/stat.h> +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +# include "sys/stat.h" # include <string.h> # include <errno.h> |