summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-12-28 09:42:06 +0000
committerJim Meyering <jim@meyering.net>2000-12-28 09:42:06 +0000
commit51d5f8a438a41284ad24bacc2c0df25ed8f8bb88 (patch)
treed6fa3f15834fd12828a0f87ba1deed78e888d7f8
parente8c1aced2ba07e538c109e8cebd2c2fe7b01294a (diff)
downloadcoreutils-51d5f8a438a41284ad24bacc2c0df25ed8f8bb88.tar.xz
(same_file_ok): Use a single auto var for
tmp_dst_sb, instead of two static vars. Likewise for tmp_src_sb.
-rw-r--r--src/copy.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/copy.c b/src/copy.c
index bd8a224f3..4a809dd0e 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -392,6 +392,8 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
{
const struct stat *src_sb_link;
const struct stat *dst_sb_link;
+ struct stat tmp_dst_sb;
+ struct stat tmp_src_sb;
int same_link;
int same = (SAME_INODE (*src_sb, *dst_sb));
@@ -424,8 +426,6 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
}
else
{
- static struct stat tmp_dst_sb;
- static struct stat tmp_src_sb;
if (!same)
return 1;
@@ -512,8 +512,6 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
if (x->xstat == lstat)
{
- static struct stat tmp_dst_sb;
- static struct stat tmp_src_sb;
if (stat (dst_path, &tmp_dst_sb)
|| stat (src_path, &tmp_src_sb)
|| ! SAME_INODE (tmp_dst_sb, tmp_dst_sb))