- Moved --keep-dirlinks code over to flist.c.
authorWayne Davison <wayned@samba.org>
Fri, 11 Jun 2004 07:40:51 +0000 (07:40 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 11 Jun 2004 07:40:51 +0000 (07:40 +0000)
- Call link_stat() with its new arg (for --keep-dirlinks support).

generator.c

index 9cbfe75..93587f6 100644 (file)
@@ -294,7 +294,7 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
                return;
        }
 
-       statret = link_stat(fname,&st);
+       statret = link_stat(fname, &st, keep_dirlinks && S_ISDIR(file->mode));
 
        if (only_existing && statret == -1 && errno == ENOENT) {
                /* we only want to update existing files */
@@ -303,15 +303,6 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
                return;
        }
 
-#if SUPPORT_LINKS
-       if (statret == 0 && keep_dirlinks
-           && S_ISLNK(st.st_mode) && S_ISDIR(file->mode)) {
-               STRUCT_STAT st2;
-               if (do_stat(fname, &st2) == 0 && S_ISDIR(st2.st_mode))
-                   st = st2;
-       }
-#endif
-
        if (statret == 0 &&
            !preserve_perms &&
            (S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {
@@ -438,7 +429,7 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
                /* try the file at compare_dest instead */
                int saveerrno = errno;
                pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);
-               statret = link_stat(fnamecmpbuf,&st);
+               statret = link_stat(fnamecmpbuf, &st, 0);
                if (!S_ISREG(st.st_mode))
                        statret = -1;
                if (statret == -1)