Call link_stat() with its new arg (for --keep-dirlinks support).
authorWayne Davison <wayned@samba.org>
Fri, 11 Jun 2004 07:40:45 +0000 (07:40 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 11 Jun 2004 07:40:45 +0000 (07:40 +0000)
hlink.c
rsync.c

diff --git a/hlink.c b/hlink.c
index 29ddbaf..4228b73 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -183,11 +183,11 @@ void do_hard_links(void)
 
        for (i = 0; i < hlink_count; i++) {
                first = file = hlink_list[i];
 
        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);
                        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;
                                if (st2.st_dev == st1.st_dev
                                    && st2.st_ino == st1.st_ino)
                                        continue;
diff --git a/rsync.c b/rsync.c
index a9119fc..ffe8ed9 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -132,7 +132,7 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
                return 0;
 
        if (!st) {
                return 0;
 
        if (!st) {
-               if (link_stat(fname,&st2) != 0) {
+               if (link_stat(fname, &st2, 0) < 0) {
                        rsyserr(FERROR, errno, "stat %s failed",
                                full_fname(fname));
                        return 0;
                        rsyserr(FERROR, errno, "stat %s failed",
                                full_fname(fname));
                        return 0;
@@ -186,7 +186,7 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
                  * destination had the setuid or setgid bits set due
                  * to the side effect of the chown call */
                if (st->st_mode & (S_ISUID | S_ISGID)) {
                  * destination had the setuid or setgid bits set due
                  * to the side effect of the chown call */
                if (st->st_mode & (S_ISUID | S_ISGID)) {
-                       link_stat(fname, st);
+                       link_stat(fname, st, 0);
                }
                updated = 1;
        }
                }
                updated = 1;
        }