diff options
| author | Richard M. Stallman | 1998-06-10 21:00:39 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-10 21:00:39 +0000 |
| commit | 58f0cb7e3110dcb8bcde02d136135721e2886d4d (patch) | |
| tree | 71d5952e7f6df19b527e2b16481b20c2626a6595 /src | |
| parent | 849eedba17e4ac5f287017a7a3a42db950c854b3 (diff) | |
| download | emacs-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -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 | ||