diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-06-10 21:00:39 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-06-10 21:00:39 +0000 |
commit | 6e5b601b5544da81f70fa44866265f8fac985212 (patch) | |
tree | cb443c5514c9e2e647b83cd6797d2389f35e16c4 | |
parent | 106d63c9d31933451565eb7840ca99f5ce8d3a3b (diff) | |
download | emacs-6e5b601b5544da81f70fa44866265f8fac985212.tar.gz |
(sys_rename): Don't examine errno if rename didn't fail.
-rw-r--r-- | src/w32.c | 5 |
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) 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; } |