aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-20 14:49:47 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-20 14:49:47 +0000
commit75103841072d71603b49ad00648e204ffcca589d (patch)
treec07868b07df1b0aa5889fab67d7fafdb7eb40870 /libbb
parent761ce14fd266d8bf78b8f9c83ec2425ede0648b9 (diff)
downloadbusybox-w32-75103841072d71603b49ad00648e204ffcca589d.tar.gz
busybox-w32-75103841072d71603b49ad00648e204ffcca589d.tar.bz2
busybox-w32-75103841072d71603b49ad00648e204ffcca589d.zip
do not do utime() on links, it acts on link targets, and we don't want that.
rename link_name to link_target, less confusing this way.
Diffstat (limited to 'libbb')
-rw-r--r--libbb/copy_file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index a6cfe122d..b68a257b5 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -197,16 +197,16 @@ int copy_file(const char *source, const char *dest, int flags)
197 int src_fd; 197 int src_fd;
198 int dst_fd; 198 int dst_fd;
199 if (ENABLE_FEATURE_PRESERVE_HARDLINKS) { 199 if (ENABLE_FEATURE_PRESERVE_HARDLINKS) {
200 char *link_name; 200 char *link_target;
201 201
202 if (!FLAGS_DEREF) { 202 if (!FLAGS_DEREF) {
203 link_name = is_in_ino_dev_hashtable(&source_stat); 203 link_target = is_in_ino_dev_hashtable(&source_stat);
204 if (link_name) { 204 if (link_target) {
205 if (link(link_name, dest) < 0) { 205 if (link(link_target, dest) < 0) {
206 ovr = ask_and_unlink(dest, flags); 206 ovr = ask_and_unlink(dest, flags);
207 if (ovr <= 0) 207 if (ovr <= 0)
208 return ovr; 208 return ovr;
209 if (link(link_name, dest) < 0) { 209 if (link(link_target, dest) < 0) {
210 bb_perror_msg("cannot create link '%s'", dest); 210 bb_perror_msg("cannot create link '%s'", dest);
211 return -1; 211 return -1;
212 } 212 }