-void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
-{
- int fd;
- STRUCT_STAT st;
- struct map_struct *buf;
- struct sum_struct *s;
- int statret;
- struct file_struct *file = flist->files[i];
- char *fnamecmp;
+/* Acts on flist->file's ndx'th item, whose name is fname. If a directory,
+ * make sure it exists, and has the right permissions/timestamp info. For
+ * all other non-regular files (symlinks, etc.) we create them here. For
+ * regular files that have changed, we try to find a basis file and then
+ * start sending checksums.
+ *
+ * Note that f_out is set to -1 when doing final directory-permission and
+ * modification-time repair. */
+static void recv_generator(char *fname, struct file_list *flist,
+ struct file_struct *file, int ndx,
+ int f_out, int f_out_name)
+{
+ static int missing_below = -1;
+ int fd = -1, f_copy = -1;
+ STRUCT_STAT st, partial_st;
+ struct file_struct *back_file = NULL;
+ int statret, stat_errno;
+ char *fnamecmp, *partialptr, *backupptr = NULL;