/* choose whether to skip a particular file */
static int skip_file(char *fname, struct file_struct *file, STRUCT_STAT *st)
{
/* choose whether to skip a particular file */
static int skip_file(char *fname, struct file_struct *file, STRUCT_STAT *st)
{
* 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.
* 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.
- **/
-void recv_generator(char *fname, struct file_struct *file, int i, int f_out)
+ */
+static void recv_generator(char *fname, struct file_struct *file, int i,
+ int f_out)
* we need to delete it. If it doesn't exist, then
* recursively create it. */
* we need to delete it. If it doesn't exist, then
* recursively create it. */
- /* f_out is set to -1 when doing final directory
- permission and modification time repair */
- if (set_perms(fname,file,NULL,0) && verbose && (f_out != -1))
+ /* f_out is set to -1 when doing final directory-permission
+ * and modification-time repair. */
+ if (set_perms(fname, file, statret ? NULL : &st, 0)
+ && verbose && f_out != -1)
/* try the file at compare_dest instead */
int saveerrno = errno;
pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);
/* try the file at compare_dest instead */
int saveerrno = errno;
pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);
} else if (verbose > 1) {
rsyserr(FERROR, errno,
"recv_generator: failed to open %s",
} else if (verbose > 1) {
rsyserr(FERROR, errno,
"recv_generator: failed to open %s",
/* files can cycle through the system more than once
* to catch initial checksum errors */
while ((i = get_redo_num()) != -1) {
struct file_struct *file = flist->files[i];
recv_generator(local_name ? local_name : f_name_to(file, fbuf),
/* files can cycle through the system more than once
* to catch initial checksum errors */
while ((i = get_redo_num()) != -1) {
struct file_struct *file = flist->files[i];
recv_generator(local_name ? local_name : f_name_to(file, fbuf),
* modified during the transfer */
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
* modified during the transfer */
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];