X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flstat.c;h=27a0cb5103dc500f5ed7dabd5ef34a8a1703df28;hb=80074d103cc72ea8f289b82c56bd3734aac82cd7;hp=a05f6747d3dc918526cf27f4b0873c1892b51efc;hpb=b4caad347f49b6fc8ec0b656e494dcd90f031b7c;p=gnulib.git diff --git a/lib/lstat.c b/lib/lstat.c index a05f6747d..27a0cb510 100644 --- a/lib/lstat.c +++ b/lib/lstat.c @@ -20,11 +20,18 @@ #include +#if !HAVE_LSTAT +/* On systems that lack symlinks, our replacement already + defined lstat as stat, so there is nothing further to do other than + avoid an empty file. */ +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 -#include -#undef __need_system_sys_stat_h +# define __need_system_sys_stat_h +# include +# include +# undef __need_system_sys_stat_h static inline int orig_lstat (const char *filename, struct stat *buf) @@ -33,10 +40,10 @@ orig_lstat (const char *filename, struct stat *buf) } /* Specification. */ -#include +# include -#include -#include +# include +# include /* lstat works differently on Linux and Solaris systems. POSIX (see `pathname resolution' in the glossary) requires that programs like @@ -81,3 +88,5 @@ rpl_lstat (const char *file, struct stat *sbuf) } return stat (file, sbuf); } + +#endif /* HAVE_LSTAT */