X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flstat.c;h=b26065ede28d786eb1579d4d7e96e6bbdb6b6013;hb=76bcf6213d2a5a01dd56c0d1235bfdad4dd7ecf2;hp=a05f6747d3dc918526cf27f4b0873c1892b51efc;hpb=b4caad347f49b6fc8ec0b656e494dcd90f031b7c;p=gnulib.git diff --git a/lib/lstat.c b/lib/lstat.c index a05f6747d..b26065ede 100644 --- a/lib/lstat.c +++ b/lib/lstat.c @@ -1,7 +1,6 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997-1999, 2000-2006, 2008-2009 Free Software - Foundation, Inc. + Copyright (C) 1997-2006, 2008-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,11 +19,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 +39,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 +87,5 @@ rpl_lstat (const char *file, struct stat *sbuf) } return stat (file, sbuf); } + +#endif /* HAVE_LSTAT */