-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 file number @p i from @p flist, whose name is @p fname.
+ *
+ * First fixes up permissions, then generates checksums for the file.
+ *
+ * @note This comment was added later by mbp who was trying to work it
+ * out. It might be wrong.
+ */
+static void recv_generator(char *fname, struct file_struct *file, int i,
+ int f_out, int f_out_name)
+{
+ 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;