diff options
author | Jim Meyering <jim@meyering.net> | 2004-02-07 16:01:02 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-02-07 16:01:02 +0000 |
commit | e80f7332e2d4522b44041f2add6d64e905f99589 (patch) | |
tree | 5b588b2864a6faa6551b9bbeeee3f2d09e495d64 /src/copy.h | |
parent | c9736bdff0126ee263c430494ebde01ae594dbfb (diff) | |
download | coreutils-e80f7332e2d4522b44041f2add6d64e905f99589.tar.xz |
Remove xstat function pointer member. The way it was used was not
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.
Diffstat (limited to 'src/copy.h')
-rw-r--r-- | src/copy.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/copy.h b/src/copy.h index 10cdce979..0979ee1af 100644 --- a/src/copy.h +++ b/src/copy.h @@ -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. */ |