diff -ur rsync-2.4.3.orig/rsync.c rsync-2.4.3.cygwin/rsync.c --- rsync-2.4.3.orig/rsync.c Sat Jan 29 03:35:03 2000 +++ rsync-2.4.3.cygwin/rsync.c Thu Jun 29 11:59:55 2000 @@ -240,9 +240,17 @@ /* move tmp file over real file */ if (robust_rename(fnametmp,fname) != 0) { - if (errno == EXDEV) { - /* rename failed on cross-filesystem link. - Copy the file instead. */ +#ifdef __CYGWIN__ + if (errno == EXDEV || errno == EACCES) + /* rename failed on cross-filesystem link + or destination may be open in shared mode by other application. + Copy the file instead. */ +#else + if (errno == EXDEV) + /* rename failed on cross-filesystem link + Copy the file instead. */ +#endif + { if (copy_file(fnametmp,fname, file->mode & INITACCESSPERMS)) { rprintf(FERROR,"copy %s -> %s : %s\n", fnametmp,fname,strerror(errno)); diff -ur rsync-2.4.3.orig/util.c rsync-2.4.3.cygwin/util.c --- rsync-2.4.3.orig/util.c Sat Apr 8 19:53:31 2000 +++ rsync-2.4.3.cygwin/util.c Thu Jun 29 12:11:01 2000 @@ -316,13 +316,17 @@ return -1; } +#ifndef __CYGWIN__ if (robust_unlink(dest) && errno != ENOENT) { rprintf(FERROR,"unlink %s: %s\n", dest,strerror(errno)); return -1; } - ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode); +#else + ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC, mode); +#endif + if (ofd == -1) { rprintf(FERROR,"open %s: %s\n", dest,strerror(errno));