aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Klessing <daniel.klessing@de.fujitsu.com>2011-11-09 16:01:09 +0100
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-11-21 11:28:50 +0700
commit55aa40a78a6509cbce541c90351b8eb10d1552a1 (patch)
tree7b6c92e02ef5cbd0e565e0800f6bdefdc4f85092
parent66106e7c9cb9f2c5ebf1b98c49c9f71acf702d71 (diff)
downloadbusybox-w32-55aa40a78a6509cbce541c90351b8eb10d1552a1.tar.gz
busybox-w32-55aa40a78a6509cbce541c90351b8eb10d1552a1.tar.bz2
busybox-w32-55aa40a78a6509cbce541c90351b8eb10d1552a1.zip
copy_file: kkip inode/device check
Inode/Device information is not present under mingw32. Don't rely on it in copy_file.c
-rw-r--r--libbb/copy_file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index d9bbb6ba3..adbc2dea3 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -147,6 +147,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
147 } 147 }
148 148
149 /* Did we ever create source ourself before? */ 149 /* Did we ever create source ourself before? */
150#if !ENABLE_PLATFORM_MINGW32
150 tp = is_in_ino_dev_hashtable(&source_stat); 151 tp = is_in_ino_dev_hashtable(&source_stat);
151 if (tp) { 152 if (tp) {
152 /* We did! it's a recursion! man the lifeboats... */ 153 /* We did! it's a recursion! man the lifeboats... */
@@ -154,6 +155,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
154 source); 155 source);
155 return -1; 156 return -1;
156 } 157 }
158#endif
157 159
158 /* Create DEST */ 160 /* Create DEST */
159 if (dest_exists) { 161 if (dest_exists) {
@@ -184,9 +186,11 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
184 return -1; 186 return -1;
185 } 187 }
186 } 188 }
189#if !ENABLE_PLATFORM_MINGW32
187 /* remember (dev,inode) of each created dir. 190 /* remember (dev,inode) of each created dir.
188 * NULL: name is not remembered */ 191 * NULL: name is not remembered */
189 add_to_ino_dev_hashtable(&dest_stat, NULL); 192 add_to_ino_dev_hashtable(&dest_stat, NULL);
193#endif
190 194
191 /* Recursively copy files in SOURCE */ 195 /* Recursively copy files in SOURCE */
192 dp = opendir(source); 196 dp = opendir(source);
@@ -256,6 +260,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
256 goto dont_cat; 260 goto dont_cat;
257 } 261 }
258 262
263#if !ENABLE_PLATFORM_MINGW32
259 if (ENABLE_FEATURE_PRESERVE_HARDLINKS && !FLAGS_DEREF) { 264 if (ENABLE_FEATURE_PRESERVE_HARDLINKS && !FLAGS_DEREF) {
260 const char *link_target; 265 const char *link_target;
261 link_target = is_in_ino_dev_hashtable(&source_stat); 266 link_target = is_in_ino_dev_hashtable(&source_stat);
@@ -273,6 +278,7 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
273 } 278 }
274 add_to_ino_dev_hashtable(&source_stat, dest); 279 add_to_ino_dev_hashtable(&source_stat, dest);
275 } 280 }
281#endif
276 282
277 src_fd = open_or_warn(source, O_RDONLY); 283 src_fd = open_or_warn(source, O_RDONLY);
278 if (src_fd < 0) 284 if (src_fd < 0)