More error messages.
[rsync.git] / hlink.c
diff --git a/hlink.c b/hlink.c
index 31c19cd83d1a8fc7ff1b26ce4dfad8b16bae9332..561ea736ba51f2dc0b58a057b5523eedbea78271 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -19,7 +19,6 @@
 
 #include "rsync.h"
 
-extern int am_server;
 extern int dry_run;
 extern int verbose;
 
@@ -57,7 +56,7 @@ void init_hard_links(struct file_list *flist)
                out_of_memory("init_hard_links");
 
        for (i = 0; i < flist->count; i++)
-               bcopy(flist->files[i], &hlink_list[i], sizeof(hlink_list[0]));
+               memcpy(&hlink_list[i], flist->files[i], sizeof(hlink_list[0]));
 
        qsort(hlink_list,flist->count,
              sizeof(hlink_list[0]),
@@ -106,14 +105,14 @@ int check_hard_link(struct file_struct *file)
 #if SUPPORT_HARD_LINKS
 static void hard_link_one(int i)
 {
-       struct stat st1,st2;
+       STRUCT_STAT st1,st2;
 
        if (link_stat(f_name(&hlink_list[i-1]),&st1) != 0) return;
 
        if (link_stat(f_name(&hlink_list[i]),&st2) != 0) {
                if (do_link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) {
                        if (verbose > 0)
-                               fprintf(FINFO,"link %s => %s : %s\n",
+                               rprintf(FINFO,"link %s => %s : %s\n",
                                        f_name(&hlink_list[i]),
                                        f_name(&hlink_list[i-1]),strerror(errno));
                        return;
@@ -121,17 +120,17 @@ static void hard_link_one(int i)
        } else {
                if (st2.st_dev == st1.st_dev && st2.st_ino == st1.st_ino) return;
                
-               if (do_unlink(f_name(&hlink_list[i])) != 0 ||
+               if (robust_unlink(f_name(&hlink_list[i])) != 0 ||
                    do_link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) {
                        if (verbose > 0)
-                               fprintf(FINFO,"link %s => %s : %s\n",
+                               rprintf(FINFO,"link %s => %s : %s\n",
                                        f_name(&hlink_list[i]),
                                        f_name(&hlink_list[i-1]),strerror(errno));
                        return;
                }
        }
        if (verbose > 0)
-               fprintf(FINFO,"%s => %s\n",
+               rprintf(FINFO,"%s => %s\n",
                        f_name(&hlink_list[i]),f_name(&hlink_list[i-1]));
 }
 #endif