Check for EINVAL from a rename error call in addition to ENOENT because
authorDavid Dykstra <dwd@samba.org>
Tue, 9 Mar 1999 21:55:16 +0000 (21:55 +0000)
committerDavid Dykstra <dwd@samba.org>
Tue, 9 Mar 1999 21:55:16 +0000 (21:55 +0000)
David Campbell <david@pastornet.net.au> reported that that helps data
be received onto a windows box running cygwin b19.

rsync.c

diff --git a/rsync.c b/rsync.c
index 87a8056..d7f2d3c 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -242,7 +242,8 @@ int make_backup(char *fname)
 
        slprintf(fnamebak,sizeof(fnamebak),"%s%s",fname,backup_suffix);
        if (do_rename(fname,fnamebak) != 0) {
-               if (errno != ENOENT) {
+               /* cygwin (at least version b19) reports EINVAL */
+               if (errno != ENOENT && errno != EINVAL) {
                        rprintf(FERROR,"rename %s %s : %s\n",fname,fnamebak,strerror(errno));
                        return 0;
                }