diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1558,12 +1558,12 @@ sys_rename (const char * oldname, const char * newname) | |||
| 1558 | { | 1558 | { |
| 1559 | /* Force temp name to require a manufactured 8.3 alias - this | 1559 | /* Force temp name to require a manufactured 8.3 alias - this |
| 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 | result = rename (oldname, temp); |
| 1564 | } | 1564 | } |
| 1565 | /* This loop must surely terminate! */ | 1565 | /* This loop must surely terminate! */ |
| 1566 | while (result < 0 && errno == EEXIST); | 1566 | while (result < 0 && (errno == EEXIST || errno == EACCES)); |
| 1567 | if (result < 0) | 1567 | if (result < 0) |
| 1568 | return -1; | 1568 | return -1; |
| 1569 | } | 1569 | } |
| @@ -1583,7 +1583,7 @@ sys_rename (const char * oldname, const char * newname) | |||
| 1583 | result = rename (temp, newname); | 1583 | result = rename (temp, newname); |
| 1584 | 1584 | ||
| 1585 | if (result < 0 | 1585 | if (result < 0 |
| 1586 | && errno == EEXIST | 1586 | && (errno == EEXIST || errno == EACCES) |
| 1587 | && _chmod (newname, 0666) == 0 | 1587 | && _chmod (newname, 0666) == 0 |
| 1588 | && _unlink (newname) == 0) | 1588 | && _unlink (newname) == 0) |
| 1589 | result = rename (temp, newname); | 1589 | result = rename (temp, newname); |