X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Flstat.c;h=db119a10d3f48db6f760dab5953696eb6b49902b;hb=dc84183747ce1703eb99685b5dbde1f65a143c06;hp=586ab16b2abfa74c2fe46deee9aa358ae336a714;hpb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;p=debian%2Fgzip diff --git a/lib/lstat.c b/lib/lstat.c index 586ab16..db119a1 100644 --- a/lib/lstat.c +++ b/lib/lstat.c @@ -1,6 +1,6 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997-2006, 2008-2010 Free Software Foundation, Inc. + Copyright (C) 1997-2006, 2008-2012 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 @@ -17,6 +17,10 @@ /* written by Jim Meyering */ +/* If the user's config.h happens to include , let it include only + the system's here, so that orig_lstat doesn't recurse to + rpl_lstat. */ +#define __need_system_sys_stat_h #include #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 # include # undef __need_system_sys_stat_h @@ -39,17 +42,20 @@ orig_lstat (const char *filename, struct stat *buf) } /* Specification. */ -# include +/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include + above. */ +# include "sys/stat.h" # include # include /* lstat works differently on Linux and Solaris systems. POSIX (see - `pathname resolution' in the glossary) requires that programs like - `ls' take into consideration the fact that FILE has a trailing slash + "pathname resolution" in the glossary) requires that programs like + 'ls' take into consideration the fact that FILE has a trailing slash when FILE is a symbolic link. On Linux and Solaris 10 systems, the lstat function already has the desired semantics (in treating - `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)', + 'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)', but on Solaris 9 and earlier it does not. If FILE has a trailing slash and specifies a symbolic link,