aboutsummaryrefslogtreecommitdiff
path: root/libbb/copy_file.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-04-19 12:28:02 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-04-19 12:28:02 +0000
commit1219879422fa33bf45d1eea0926483821e375bef (patch)
treeed5357a634d6d4af065f172e6b2307c47f3a0a07 /libbb/copy_file.c
parentc6a99b993d2a97792eb122255ec84cbcae7b55e0 (diff)
downloadbusybox-1219879422fa33bf45d1eea0926483821e375bef.tar.gz
Dont try and preserve hard links to directories.
The linux kernel doesnt allow hard links to directories, SUS says its implementation specific. cramfs gives empty directories and 0 length files the same node it makies it difficult to distinguish from hard links.
Diffstat (limited to 'libbb/copy_file.c')
-rw-r--r--libbb/copy_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 7ddb9a23f..68a1ded04 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -242,7 +242,9 @@ int copy_file(const char *source, const char *dest, int flags)
}
#ifdef CONFIG_FEATURE_PRESERVE_HARDLINKS
- add_to_ino_dev_hashtable(&source_stat, dest);
+ if (! S_ISDIR(source_stat.st_mode)) {
+ add_to_ino_dev_hashtable(&source_stat, dest);
+ }
#endif
end: