From 7ef60bda00dc4b2fbccf67a40885569ab45eb7aa Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 30 Nov 2014 09:50:05 +0000 Subject: Don't store file details in inode hash table --- libbb/copy_file.c | 6 ------ libbb/inode_hash.c | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 935a9a4c4..a427c441f 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -142,7 +142,6 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) } /* Did we ever create source ourself before? */ -#if !ENABLE_PLATFORM_MINGW32 tp = is_in_ino_dev_hashtable(&source_stat); if (tp) { /* We did! it's a recursion! man the lifeboats... */ @@ -150,7 +149,6 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) source); return -1; } -#endif if (dest_exists) { if (!S_ISDIR(dest_stat.st_mode)) { @@ -181,11 +179,9 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) return -1; } } -#if !ENABLE_PLATFORM_MINGW32 /* remember (dev,inode) of each created dir. * NULL: name is not remembered */ add_to_ino_dev_hashtable(&dest_stat, NULL); -#endif /* Recursively copy files in SOURCE */ dp = opendir(source); @@ -255,7 +251,6 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) goto dont_cat; } -#if !ENABLE_PLATFORM_MINGW32 if (ENABLE_FEATURE_PRESERVE_HARDLINKS && !FLAGS_DEREF) { const char *link_target; link_target = is_in_ino_dev_hashtable(&source_stat); @@ -273,7 +268,6 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags) } add_to_ino_dev_hashtable(&source_stat, dest); } -#endif src_fd = open_or_warn(source, O_RDONLY); if (src_fd < 0) diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c index f11c2afb2..64f43b885 100644 --- a/libbb/inode_hash.c +++ b/libbb/inode_hash.c @@ -59,6 +59,7 @@ char* FAST_FUNC is_in_ino_dev_hashtable(const struct stat *statbuf) /* Add statbuf to statbuf hash table */ void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) { +#if !ENABLE_PLATFORM_MINGW32 int i; ino_dev_hashtable_bucket_t *bucket; @@ -76,6 +77,7 @@ void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char * i = hash_inode(statbuf->st_ino); bucket->next = ino_dev_hashtable[i]; ino_dev_hashtable[i] = bucket; +#endif } #if ENABLE_DU || ENABLE_FEATURE_CLEAN_UP -- cgit v1.2.3-55-g6feb