Include "lstat.h" rather than rolling our own.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Jul 2005 09:31:19 +0000 (09:31 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Jul 2005 09:31:19 +0000 (09:31 +0000)
src/copy.h
src/ls.c
src/remove.c

index f90bb96..8ef0f9d 100644 (file)
@@ -22,6 +22,7 @@
 
 # include <stdbool.h>
 # include "hash.h"
+# include "lstat.h"
 
 /* Control creation of sparse files (files with holes).  */
 enum Sparse_type
@@ -197,15 +198,6 @@ struct cp_options
    ? lstat (Src_name, Src_sb) \
    : stat (Src_name, Src_sb))
 
-/* Arrange to make lstat calls go through the wrapper function
-   on systems with an lstat function that does not dereference symlinks
-   that are specified with a trailing slash.  */
-# if ! LSTAT_FOLLOWS_SLASHED_SYMLINK
-int rpl_lstat (const char *, struct stat *);
-#  undef lstat
-#  define lstat rpl_lstat
-# endif
-
 /* Arrange to make rename calls go through the wrapper function
    on systems with a rename function that fails for a source file name
    specified with a trailing slash.  */
index 1a6a9c5..efbd6ef 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -115,6 +115,7 @@ int wcwidth ();
 #include "filemode.h"
 #include "inttostr.h"
 #include "ls.h"
+#include "lstat.h"
 #include "mbswidth.h"
 #include "obstack.h"
 #include "quote.h"
@@ -138,15 +139,6 @@ int wcwidth ();
    Subtracting doesn't always work, due to overflow.  */
 #define longdiff(a, b) ((a) < (b) ? -1 : (a) > (b))
 
-/* Arrange to make lstat calls go through the wrapper function
-   on systems with an lstat function that does not dereference symlinks
-   that are specified with a trailing slash.  */
-#if ! LSTAT_FOLLOWS_SLASHED_SYMLINK
-int rpl_lstat (const char *, struct stat *);
-# undef lstat
-# define lstat(Name, Stat_buf) rpl_lstat(Name, Stat_buf)
-#endif
-
 #if HAVE_STRUCT_DIRENT_D_TYPE && defined DTTOIF
 # define DT_INIT(Val) = Val
 #else
index 7c55787..aad4856 100644 (file)
@@ -32,6 +32,7 @@
 #include "file-type.h"
 #include "hash.h"
 #include "hash-pjw.h"
+#include "lstat.h"
 #include "obstack.h"
 #include "quote.h"
 #include "remove.h"
@@ -78,13 +79,6 @@ enum Prompt_action
     PA_REMOVE_DIR
   };
 
-/* On systems with an lstat function that accepts the empty string,
-   arrange to make lstat calls go through the wrapper function.  */
-#if HAVE_LSTAT_EMPTY_STRING_BUG
-int rpl_lstat (const char *, struct stat *);
-# define lstat(Name, Stat_buf) rpl_lstat(Name, Stat_buf)
-#endif
-
 /* Initial capacity of per-directory hash table of entries that have
    been processed but not been deleted.  */
 #define HT_UNREMOVABLE_INITIAL_CAPACITY 13