aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/copy_file.c5
-rw-r--r--libbb/inode_hash.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index db7a00060..abe034f50 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -105,10 +105,11 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
105 return -1; 105 return -1;
106 } 106 }
107 } else { 107 } else {
108#if !ENABLE_PLATFORM_MINGW32 || ENABLE_FEATURE_EXTRA_FILE_DATA 108#if ENABLE_PLATFORM_POSIX || ENABLE_FEATURE_EXTRA_FILE_DATA
109 /* MinGW does not have inode, and does not use device */
110 if (source_stat.st_dev == dest_stat.st_dev 109 if (source_stat.st_dev == dest_stat.st_dev
111 && source_stat.st_ino == dest_stat.st_ino 110 && source_stat.st_ino == dest_stat.st_ino
111 /* ignore invalid inode numbers */
112 && (ENABLE_FEATURE_EXTRA_FILE_DATA && source_stat.st_ino != 0)
112 ) { 113 ) {
113 bb_error_msg("'%s' and '%s' are the same file", source, dest); 114 bb_error_msg("'%s' and '%s' are the same file", source, dest);
114 return -1; 115 return -1;
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c
index 4142813e3..37fed9c82 100644
--- a/libbb/inode_hash.c
+++ b/libbb/inode_hash.c
@@ -61,6 +61,11 @@ void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char *
61 int i; 61 int i;
62 ino_dev_hashtable_bucket_t *bucket; 62 ino_dev_hashtable_bucket_t *bucket;
63 63
64#if ENABLE_FEATURE_EXTRA_FILE_DATA
65 /* ignore invalid inode numbers */
66 if (statbuf->st_ino == 0)
67 return;
68#endif
64 if (!name) 69 if (!name)
65 name = ""; 70 name = "";
66 bucket = xmalloc(sizeof(ino_dev_hashtable_bucket_t) + strlen(name)); 71 bucket = xmalloc(sizeof(ino_dev_hashtable_bucket_t) + strlen(name));