From 6218c7bf4201de3e188b2365cb917f34b832992c Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 11 Jun 2004 07:40:51 +0000 Subject: [PATCH] - Moved --keep-dirlinks code over to flist.c. - Call link_stat() with its new arg (for --keep-dirlinks support). --- generator.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/generator.c b/generator.c index 9cbfe75d..93587f6c 100644 --- a/generator.c +++ b/generator.c @@ -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) -- 2.34.1