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 b26065ede28..d786288f2b7 100644 --- a/lib/lstat.c +++ b/lib/lstat.c | |||
| @@ -17,6 +17,10 @@ | |||
| 17 | 17 | ||
| 18 | /* written by Jim Meyering */ | 18 | /* written by Jim Meyering */ |
| 19 | 19 | ||
| 20 | /* If the user's config.h happens to include <sys/stat.h>, let it include only | ||
| 21 | the system's <sys/stat.h> here, so that orig_lstat doesn't recurse to | ||
| 22 | rpl_lstat. */ | ||
| 23 | #define __need_system_sys_stat_h | ||
| 20 | #include <config.h> | 24 | #include <config.h> |
| 21 | 25 | ||
| 22 | #if !HAVE_LSTAT | 26 | #if !HAVE_LSTAT |
| @@ -27,7 +31,6 @@ typedef int dummy; | |||
| 27 | #else /* HAVE_LSTAT */ | 31 | #else /* HAVE_LSTAT */ |
| 28 | 32 | ||
| 29 | /* Get the original definition of lstat. It might be defined as a macro. */ | 33 | /* Get the original definition of lstat. It might be defined as a macro. */ |
| 30 | # define __need_system_sys_stat_h | ||
| 31 | # include <sys/types.h> | 34 | # include <sys/types.h> |
| 32 | # include <sys/stat.h> | 35 | # include <sys/stat.h> |
| 33 | # undef __need_system_sys_stat_h | 36 | # undef __need_system_sys_stat_h |
| @@ -39,7 +42,10 @@ orig_lstat (const char *filename, struct stat *buf) | |||
| 39 | } | 42 | } |
| 40 | 43 | ||
| 41 | /* Specification. */ | 44 | /* Specification. */ |
| 42 | # include <sys/stat.h> | 45 | /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc |
| 46 | eliminates this include because of the preliminary #include <sys/stat.h> | ||
| 47 | above. */ | ||
| 48 | # include "sys/stat.h" | ||
| 43 | 49 | ||
| 44 | # include <string.h> | 50 | # include <string.h> |
| 45 | # include <errno.h> | 51 | # include <errno.h> |