summaryrefslogtreecommitdiff
path: root/hlink.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-12-16 08:48:36 +0000
committerAndrew Tridgell <tridge@samba.org>1997-12-16 08:48:36 +0000
commit9a52223bce23c54dabff27c8e02d4814c7a498dd (patch)
tree73f9c8b183241d1eda511c9533efd2a3e2a74b86 /hlink.c
parent2b7e9042b631fef022410b3236d762d097c172fd (diff)
downloadrsync-9a52223bce23c54dabff27c8e02d4814c7a498dd.tar.gz
- fixed the "write exception" error. I was resetting got_select at the
wrong point - fixed a seg fault error in flist.c - only print hlink debug messages when using -v
Diffstat (limited to 'hlink.c')
-rw-r--r--hlink.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/hlink.c b/hlink.c
index 60b639bf..6e4e31fb 100644
--- a/hlink.c
+++ b/hlink.c
@@ -21,6 +21,7 @@
extern int am_server;
extern int dry_run;
+extern int verbose;
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct *f1,struct file_struct *f2)
@@ -118,8 +119,10 @@ void do_hard_links(struct file_list *flist)
if (lstat(hlink_list[i-1].name,&st1) != 0) continue;
if (lstat(hlink_list[i].name,&st2) != 0) {
if (!dry_run && link(hlink_list[i-1].name,hlink_list[i].name) != 0) {
- fprintf(FINFO,"link %s => %s : %s\n",
- hlink_list[i].name,hlink_list[i-1].name,strerror(errno));
+ if (verbose > 0)
+ fprintf(FINFO,"link %s => %s : %s\n",
+ hlink_list[i].name,
+ hlink_list[i-1].name,strerror(errno));
continue;
}
} else {
@@ -127,13 +130,16 @@ void do_hard_links(struct file_list *flist)
if (!dry_run && (unlink(hlink_list[i].name) != 0 ||
link(hlink_list[i-1].name,hlink_list[i].name) != 0)) {
- fprintf(FINFO,"link %s => %s : %s\n",
- hlink_list[i].name,hlink_list[i-1].name,strerror(errno));
+ if (verbose > 0)
+ fprintf(FINFO,"link %s => %s : %s\n",
+ hlink_list[i].name,
+ hlink_list[i-1].name,strerror(errno));
continue;
}
}
- fprintf(FINFO,"%s => %s\n",
- hlink_list[i].name,hlink_list[i-1].name);
+ if (verbose > 0)
+ fprintf(FINFO,"%s => %s\n",
+ hlink_list[i].name,hlink_list[i-1].name);
}
}
#endif