aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-06-10 21:00:39 +0000
committerRichard M. Stallman1998-06-10 21:00:39 +0000
commit58f0cb7e3110dcb8bcde02d136135721e2886d4d (patch)
tree71d5952e7f6df19b527e2b16481b20c2626a6595 /src
parent849eedba17e4ac5f287017a7a3a42db950c854b3 (diff)
downloademacs-58f0cb7e3110dcb8bcde02d136135721e2886d4d.tar.gz
emacs-58f0cb7e3110dcb8bcde02d136135721e2886d4d.zip
(sys_rename): Don't examine errno if rename didn't fail.
Diffstat (limited to 'src')
-rw-r--r--src/w32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/w32.c b/src/w32.c
index 71ba574686f..da7d29b15a0 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1560,10 +1560,11 @@ sys_rename (const char * oldname, const char * newname)
1560 seems to make the second rename work properly. */ 1560 seems to make the second rename work properly. */
1561 sprintf (p, ".%s.%u", o, i); 1561 sprintf (p, ".%s.%u", o, i);
1562 i++; 1562 i++;
1563 result = rename (oldname, temp);
1563 } 1564 }
1564 /* This loop must surely terminate! */ 1565 /* This loop must surely terminate! */
1565 while (rename (oldname, temp) < 0 && errno == EEXIST); 1566 while (result < 0 && errno == EEXIST);
1566 if (errno != EEXIST) 1567 if (result < 0)
1567 return -1; 1568 return -1;
1568 } 1569 }
1569 1570