X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b14e3e21ec6702d27257a1400681fc36ee10282f..1938d88c74281393f180f7ac3c77418b926ed6e6:/lib/lstat.c diff --git a/lib/lstat.c b/lib/lstat.c index b26065ede2..db119a10d3 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-2011 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,