Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[rsync/rsync.git]
/
hlink.c
diff --git
a/hlink.c
b/hlink.c
index
238fc02
..
495c0a8
100644
(file)
--- a/
hlink.c
+++ b/
hlink.c
@@
-21,6
+21,7
@@
extern int am_server;
extern int dry_run;
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)
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct *f1,struct file_struct *f2)
@@
-71,7
+72,7
@@
void init_hard_links(struct file_list *flist)
int check_hard_link(struct file_struct *file)
{
#if SUPPORT_HARD_LINKS
int check_hard_link(struct file_struct *file)
{
#if SUPPORT_HARD_LINKS
- int low=0,high=hlink_count;
+ int low=0,high=hlink_count
-1
;
int mid=0,ret=0;
if (!hlink_list || !S_ISREG(file->mode)) return 0;
int mid=0,ret=0;
if (!hlink_list || !S_ISREG(file->mode)) return 0;
@@
-115,11
+116,13
@@
void do_hard_links(struct file_list *flist)
hlink_list[i].inode == hlink_list[i-1].inode) {
struct stat st1,st2;
hlink_list[i].inode == hlink_list[i-1].inode) {
struct stat st1,st2;
- if (lstat(hlink_list[i-1].name,&st1) != 0) continue;
- if (lstat(hlink_list[i].name,&st2) != 0) {
+ if (l
ink_
stat(hlink_list[i-1].name,&st1) != 0) continue;
+ if (l
ink_
stat(hlink_list[i].name,&st2) != 0) {
if (!dry_run && link(hlink_list[i-1].name,hlink_list[i].name) != 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 {
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)) {
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;
}
}
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
}
}
#endif