diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -489,11 +489,16 @@ finish: int copy_or_link_file(const char *src, const char *dst, int c) { - if (c) - unlink(dst); if (link(src, dst) < 0) { + if (errno == EEXIST && c) { + unlink(dst); + + if (link(src, dst) == 0) + return 0; + } + if (errno == EXDEV || errno == EPERM) return copy_file(src, dst, c); |