]> git.eshelyaron.com Git - emacs.git/commitdiff
(sys_rename): Don't examine errno if rename didn't fail.
authorRichard M. Stallman <rms@gnu.org>
Wed, 10 Jun 1998 21:00:39 +0000 (21:00 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 10 Jun 1998 21:00:39 +0000 (21:00 +0000)
src/w32.c

index 71ba574686fe7f97abbd282a06f18f2ffab9b36d..da7d29b15a0ea77a816f7f64018921cd9701fad6 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -1560,10 +1560,11 @@ sys_rename (const char * oldname, const char * newname)
             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;
     }