if (compare_dest != NULL) {
if (access(fname, 0) != 0) {
- snprintf(fnamecmpdest,MAXPATHLEN,"%s/%s",
- compare_dest,fname);
+ pathjoin(fnamecmpdest, sizeof fnamecmpdest,
+ compare_dest, fname);
fname = fnamecmpdest;
}
}
}
#endif
- if (preserve_hard_links && check_hard_link(file)) {
+ if (preserve_hard_links && file->link_u.links && file->F_HEAD != file) {
if (verbose > 1) {
rprintf(FINFO, "recv_generator: \"%s\" is a hard link\n",
f_name(file));
if ((statret == -1) && (compare_dest != NULL)) {
/* try the file at compare_dest instead */
int saveerrno = errno;
- snprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s",compare_dest,fname);
+ pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);
statret = link_stat(fnamecmpbuf,&st);
if (!S_ISREG(st.st_mode))
statret = -1;
}
-void generate_files(int f,struct file_list *flist,char *local_name,int f_recv)
+void generate_files(int f, struct file_list *flist, char *local_name)
{
int i;
int phase=0;
file = ©
}
- recv_generator(local_name? local_name
- : f_name_to(file,fbuf,sizeof fbuf), file, i, f);
+ recv_generator(local_name ? local_name : f_name_to(file, fbuf),
+ file, i, f);
}
phase++;
/* files can cycle through the system more than once
* to catch initial checksum errors */
- while ((i = read_int(f_recv)) != -1) {
+ while ((i = get_redo_num()) != -1) {
struct file_struct *file = flist->files[i];
- recv_generator(local_name? local_name
- : f_name_to(file,fbuf,sizeof fbuf), file, i, f);
+ recv_generator(local_name ? local_name : f_name_to(file, fbuf),
+ file, i, f);
}
phase++;