diff options
| author | Andrew Innes | 2000-12-17 23:14:55 +0000 |
|---|---|---|
| committer | Andrew Innes | 2000-12-17 23:14:55 +0000 |
| commit | cfb5e8555e85d10ba7cfad00b53963f7b388fab3 (patch) | |
| tree | 2ced51d79726974f3ae0f67e8a8d04fcae7f1a01 /src | |
| parent | 2254bcde534143e48b624128a43e86699342b61b (diff) | |
| download | emacs-cfb5e8555e85d10ba7cfad00b53963f7b388fab3.tar.gz emacs-cfb5e8555e85d10ba7cfad00b53963f7b388fab3.zip | |
(sys_rename): Only check errno against EEXIST, and not
EACCES, when determining whether rename failed because the target
exists. This was resulting in indefinite looping on Windows 9x if
the source file was locked by another process.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1807,7 +1807,7 @@ sys_open (const char * path, int oflag, int mode) | |||
| 1807 | int | 1807 | int |
| 1808 | sys_rename (const char * oldname, const char * newname) | 1808 | sys_rename (const char * oldname, const char * newname) |
| 1809 | { | 1809 | { |
| 1810 | int result; | 1810 | BOOL result; |
| 1811 | char temp[MAX_PATH]; | 1811 | char temp[MAX_PATH]; |
| 1812 | 1812 | ||
| 1813 | /* MoveFile on Windows 95 doesn't correctly change the short file name | 1813 | /* MoveFile on Windows 95 doesn't correctly change the short file name |
| @@ -1851,7 +1851,7 @@ sys_rename (const char * oldname, const char * newname) | |||
| 1851 | result = rename (oldname, temp); | 1851 | result = rename (oldname, temp); |
| 1852 | } | 1852 | } |
| 1853 | /* This loop must surely terminate! */ | 1853 | /* This loop must surely terminate! */ |
| 1854 | while (result < 0 && (errno == EEXIST || errno == EACCES)); | 1854 | while (result < 0 && errno == EEXIST); |
| 1855 | if (result < 0) | 1855 | if (result < 0) |
| 1856 | return -1; | 1856 | return -1; |
| 1857 | } | 1857 | } |
| @@ -1871,7 +1871,7 @@ sys_rename (const char * oldname, const char * newname) | |||
| 1871 | result = rename (temp, newname); | 1871 | result = rename (temp, newname); |
| 1872 | 1872 | ||
| 1873 | if (result < 0 | 1873 | if (result < 0 |
| 1874 | && (errno == EEXIST || errno == EACCES) | 1874 | && errno == EEXIST |
| 1875 | && _chmod (newname, 0666) == 0 | 1875 | && _chmod (newname, 0666) == 0 |
| 1876 | && _unlink (newname) == 0) | 1876 | && _unlink (newname) == 0) |
| 1877 | result = rename (temp, newname); | 1877 | result = rename (temp, newname); |