summaryrefslogtreecommitdiff
path: root/libbb/copy_file.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-06-20 14:49:47 +0000
committerDenis Vlasenko2007-06-20 14:49:47 +0000
commit75103841072d71603b49ad00648e204ffcca589d (patch)
treec07868b07df1b0aa5889fab67d7fafdb7eb40870 /libbb/copy_file.c
parent761ce14fd266d8bf78b8f9c83ec2425ede0648b9 (diff)
downloadbusybox-75103841072d71603b49ad00648e204ffcca589d.zip
busybox-75103841072d71603b49ad00648e204ffcca589d.tar.gz
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/copy_file.c')
-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 a6cfe12..b68a257 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)
int src_fd;
int dst_fd;
if (ENABLE_FEATURE_PRESERVE_HARDLINKS) {
- char *link_name;
+ char *link_target;
if (!FLAGS_DEREF) {
- link_name = is_in_ino_dev_hashtable(&source_stat);
- if (link_name) {
- if (link(link_name, dest) < 0) {
+ link_target = is_in_ino_dev_hashtable(&source_stat);
+ if (link_target) {
+ if (link(link_target, dest) < 0) {
ovr = ask_and_unlink(dest, flags);
if (ovr <= 0)
return ovr;
- if (link(link_name, dest) < 0) {
+ if (link(link_target, dest) < 0) {
bb_perror_msg("cannot create link '%s'", dest);
return -1;
}