]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Remove xstat function pointer member. The way it was used was not
authorJim Meyering <jim@meyering.net>
Sat, 7 Feb 2004 16:01:02 +0000 (16:01 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 7 Feb 2004 16:01:02 +0000 (16:01 +0000)
portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
inline `stat' and `lstat' functions, thus making the tests of
`xstat == lstat' in copy.c always fail.

(struct cp_options) [xstat]: Remove member.
(XSTAT): New macro.

src/copy.h

index 10cdce9796b75c83ba796c0575ca9a0781e2920a..0979ee1af3be868854ff903f4b0c2d99f2dedfd4 100644 (file)
@@ -153,10 +153,6 @@ struct cp_options
   /* If nonzero, display the names of the files before copying them. */
   int verbose;
 
-  /* A pointer to either lstat or stat, depending on
-     whether the copy should dereference symlinks.  */
-  int (*xstat) ();
-
   /* If nonzero, stdin is a tty.  */
   int stdin_tty;
 
@@ -178,6 +174,11 @@ struct cp_options
 int stat ();
 int lstat ();
 
+# define XSTAT(X, Src_path, Src_sb) \
+  ((X)->dereference == DEREF_NEVER \
+   ? lstat (Src_path, Src_sb) \
+   : stat (Src_path, 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.  */