From: Richard M. Stallman Date: Wed, 10 Jun 1998 21:00:39 +0000 (+0000) Subject: (sys_rename): Don't examine errno if rename didn't fail. X-Git-Tag: emacs-20.3~649 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58f0cb7e3110dcb8bcde02d136135721e2886d4d;p=emacs.git (sys_rename): Don't examine errno if rename didn't fail. --- 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; }