# HG changeset patch # User Andrew Innes # Date 977094895 0 # Node ID 69143373d98d04ce9c411e9524ba5eef6e504759 # Parent 7108531c744b9f8c254ad83b3db76e7c895f7cda (sys_rename): Only check errno against EEXIST, and not EACCES, when determining whether rename failed because the target exists. This was resulting in indefinite looping on Windows 9x if the source file was locked by another process. diff -r 7108531c744b -r 69143373d98d src/w32.c --- a/src/w32.c Sun Dec 17 23:13:26 2000 +0000 +++ b/src/w32.c Sun Dec 17 23:14:55 2000 +0000 @@ -1807,7 +1807,7 @@ int sys_rename (const char * oldname, const char * newname) { - int result; + BOOL result; char temp[MAX_PATH]; /* MoveFile on Windows 95 doesn't correctly change the short file name @@ -1851,7 +1851,7 @@ result = rename (oldname, temp); } /* This loop must surely terminate! */ - while (result < 0 && (errno == EEXIST || errno == EACCES)); + while (result < 0 && errno == EEXIST); if (result < 0) return -1; } @@ -1871,7 +1871,7 @@ result = rename (temp, newname); if (result < 0 - && (errno == EEXIST || errno == EACCES) + && errno == EEXIST && _chmod (newname, 0666) == 0 && _unlink (newname) == 0) result = rename (temp, newname);