-- if (!S_ISDIR(st.st_mode)
-+ if (!S_ISDIR(sx.st.st_mode)
- && (len = readlink(fname, lnk, MAXPATHLEN-1)) > 0) {
- lnk[len] = 0;
- /* A link already pointing to the
-@@ -968,10 +1020,10 @@ static void recv_generator(char *fname,
- * required. */
- if (strcmp(lnk, file->u.link) == 0) {
- if (itemizing) {
-- itemize(file, ndx, 0, &st, 0,
-+ itemize(file, ndx, 0, &sx, 0,
- 0, NULL);
- }
-- set_file_attrs(fname, file, &st,
-+ set_file_attrs(fname, file, &sx,
- maybe_ATTRS_REPORT);
- if (preserve_hard_links
- && file->link_u.links) {
-@@ -984,9 +1036,9 @@ static void recv_generator(char *fname,
+- if (!S_ISLNK(st.st_mode))
++ if (!S_ISLNK(sx.st.st_mode))
+ statret = -1;
+ else if ((len = readlink(fname, lnk, MAXPATHLEN-1)) > 0
+ && strncmp(lnk, sl, len) == 0 && sl[len] == '\0') {
+ /* The link is pointing to the right place. */
+ if (itemizing)
+- itemize(file, ndx, 0, &st, 0, 0, NULL);
+- set_file_attrs(fname, file, &st, maybe_ATTRS_REPORT);
++ itemize(file, ndx, 0, &sx, 0, 0, NULL);
++ set_file_attrs(fname, file, &sx, maybe_ATTRS_REPORT);
+ #ifdef SUPPORT_HARD_LINKS
+ if (preserve_hard_links && F_IS_HLINKED(file))
+- finish_hard_link(file, fname, &st, itemizing, code, -1);
++ finish_hard_link(file, fname, &sx.st, itemizing, code, -1);
+ #endif
+ if (remove_source_files == 1)
+ goto return_with_success;
+@@ -1278,10 +1333,10 @@ static void recv_generator(char *fname,