+#if SUPPORT_LINKS
+ if (preserve_links && S_ISLNK(mode)) {
+ linkname_len = read_int(f) + 1; /* count the '\0' */
+ if (linkname_len <= 0 || linkname_len > MAXPATHLEN) {
+ rprintf(FERROR, "overflow: linkname_len=%d\n",
+ linkname_len - 1);
+ overflow("receive_file_entry");
+ }
+ }
+ else
+#endif
+ linkname_len = 0;
+
+ sum_len = always_checksum && S_ISREG(mode) ? MD4_SUM_LENGTH : 0;
+
+ alloc_len = file_struct_len + dirname_len + basename_len
+ + linkname_len + sum_len;
+ bp = pool_alloc(flist->file_pool, alloc_len, "receive_file_entry");
+
+ file = *fptr = (struct file_struct *)bp;
+ memset(bp, 0, file_struct_len);
+ bp += file_struct_len;
+
+ file->flags = 0;
+ file->modtime = modtime;
+ file->length = file_length;
+ file->mode = mode;
+ file->uid = uid;
+ file->gid = gid;
+
+ if (S_ISDIR(mode)) {
+ if (flags & XMIT_DEL_START) {
+ in_del_hier = 1;
+ del_heir_name_len = l1 + l2;
+ file->flags |= FLAG_DEL_START;
+ } else if (delete_during && in_del_hier) {
+ if (!relative_paths || (l1 >= del_heir_name_len
+ && thisname[del_heir_name_len] == '/'))
+ file->flags |= FLAG_DEL_START;
+ else
+ in_del_hier = 0;
+ }
+ }