If there is no lchown(), don't try to set the user & group of a symlink.
[rsync/rsync.git] / hlink.c
diff --git a/hlink.c b/hlink.c
index 29ddbaf..1a489c2 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -135,6 +135,7 @@ void init_hard_links(struct file_list *flist)
 
 int hard_link_check(struct file_struct *file, int skip)
 {
+#if SUPPORT_HARD_LINKS
        if (!hlink_list || !file->link_u.links)
                return 0;
        if (skip && !(file->flags & FLAG_HLINK_EOL))
@@ -146,6 +147,7 @@ int hard_link_check(struct file_struct *file, int skip)
                }
                return 1;
        }
+#endif
        return 0;
 }
 
@@ -183,11 +185,11 @@ void do_hard_links(void)
 
        for (i = 0; i < hlink_count; i++) {
                first = file = hlink_list[i];
-               if (link_stat(f_name_to(first, hlink1), &st1) != 0)
+               if (link_stat(f_name_to(first, hlink1), &st1, 0) < 0)
                        continue;
                while ((file = file->F_NEXT) != first) {
                        hlink2 = f_name(file);
-                       if (link_stat(hlink2, &st2) == 0) {
+                       if (link_stat(hlink2, &st2, 0) == 0) {
                                if (st2.st_dev == st1.st_dev
                                    && st2.st_ino == st1.st_ino)
                                        continue;