diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-12-16 08:48:36 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-12-16 08:48:36 +0000 |
commit | 9a52223bce23c54dabff27c8e02d4814c7a498dd (patch) | |
tree | 73f9c8b183241d1eda511c9533efd2a3e2a74b86 | |
parent | 2b7e9042b631fef022410b3236d762d097c172fd (diff) | |
download | rsync-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
-rw-r--r-- | flist.c | 8 | ||||
-rw-r--r-- | hlink.c | 18 | ||||
-rw-r--r-- | io.c | 5 |
3 files changed, 20 insertions, 11 deletions
@@ -360,8 +360,10 @@ static void send_directory(int f,struct file_list *flist,char *dir) strncpy(fname,dir,MAXPATHLEN-1); fname[MAXPATHLEN-1]=0; l = strlen(fname); - if (fname[l-1] != '/') - strcat(fname,"/"); + if (fname[l-1] != '/') { + strcat(fname,"/"); + l++; + } p = fname + strlen(fname); if (cvs_exclude) { @@ -373,7 +375,7 @@ static void send_directory(int f,struct file_list *flist,char *dir) if (strcmp(di->d_name,".")==0 || strcmp(di->d_name,"..")==0) continue; - strncpy(p,di->d_name,MAXPATHLEN-l); + strncpy(p,di->d_name,MAXPATHLEN-(l+1)); send_file_name(f,flist,fname); } @@ -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 @@ -256,6 +256,9 @@ static int writefd(int fd,char *buf,int len) exit_cleanup(1); } + got_select = 0; + + if (ret == -1) { read_check(buffer_f_in); @@ -269,8 +272,6 @@ static int writefd(int fd,char *buf,int len) fd_count = buffer_f_in+1; } - got_select = 0; - tv.tv_sec = BLOCKING_TIMEOUT; tv.tv_usec = 0; count = select(fd_count,buffer_f_in == -1? NULL: &r_fds, |