compat/mingw.c: Teach mingw_rename() to replace read-only files
commite12c7f1492cce63377ff393cb5cc60ef5aa80d63
authorJohannes Sixt <j6t@kdbg.org>
Wed, 19 Nov 2008 15:16:42 +0000 (19 16:16 +0100)
committerJohannes Sixt <j6t@kdbg.org>
Wed, 19 Nov 2008 15:16:42 +0000 (19 16:16 +0100)
treecea787b10dab0770138574db589073ce8ed0d34d
parent8054a9ec602701973ca4010b5d37d6ec1889ec86
compat/mingw.c: Teach mingw_rename() to replace read-only files

On POSIX, rename() can replace files that are not writable. On Windows,
however, read-only files cannot be replaced without additional efforts:
We have to make the destination writable first.

Since the situations where the destination is read-only are rare, we do not
make the destination writable on every invocation, but only if the first
try to rename a file failed with an "access denied" error.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
compat/mingw.c