changeset 22430:921311b43bf4

(sys_rename): Don't examine errno if rename didn't fail.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Jun 1998 21:00:39 +0000
parents 38486c386abb
children aabf58b0a724
files src/w32.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32.c	Wed Jun 10 20:59:16 1998 +0000
+++ b/src/w32.c	Wed Jun 10 21:00:39 1998 +0000
@@ -1560,10 +1560,11 @@
 	     seems to make the second rename work properly.  */
 	  sprintf (p, ".%s.%u", o, i);
 	  i++;
+	  result = rename (oldname, temp);
 	}
       /* This loop must surely terminate!  */
-      while (rename (oldname, temp) < 0 && errno == EEXIST);
-      if (errno != EEXIST)
+      while (result < 0 && errno == EEXIST);
+      if (result < 0)
 	return -1;
     }