diff src/w32.c @ 22501:d2edb98d0fa5

(sys_rename): On some network drives, rename fails with EACCES instead of EEXIST if target already exists.
author Richard M. Stallman <rms@gnu.org>
date Tue, 16 Jun 1998 04:33:08 +0000
parents 921311b43bf4
children d4f3552a85f2
line wrap: on
line diff
--- a/src/w32.c	Tue Jun 16 04:32:03 1998 +0000
+++ b/src/w32.c	Tue Jun 16 04:33:08 1998 +0000
@@ -1558,12 +1558,12 @@
 	{
 	  /* Force temp name to require a manufactured 8.3 alias - this
 	     seems to make the second rename work properly.  */
-	  sprintf (p, ".%s.%u", o, i);
+	  sprintf (p, "_.%s.%u", o, i);
 	  i++;
 	  result = rename (oldname, temp);
 	}
       /* This loop must surely terminate!  */
-      while (result < 0 && errno == EEXIST);
+      while (result < 0 && (errno == EEXIST || errno == EACCES));
       if (result < 0)
 	return -1;
     }
@@ -1583,7 +1583,7 @@
   result = rename (temp, newname);
 
   if (result < 0
-      && errno == EEXIST
+      && (errno == EEXIST || errno == EACCES)
       && _chmod (newname, 0666) == 0
       && _unlink (newname) == 0)
     result = rename (temp, newname);