Windows: always chmod(, 0666) before unlink().

On Windows, read-only files cannot be deleted. To make sure that
deletion does not fail because of this, always call chmod() before
unlink().

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Schindelin 2007-01-23 13:39:09 +01:00 committed by Johannes Sixt
parent f7597acac0
commit 132a6e903f

View File

@ -106,6 +106,14 @@ static inline int mingw_mkdir(const char *path, int mode)
}
#define mkdir mingw_mkdir
static inline int mingw_unlink(const char *pathname)
{
/* read-only files cannot be removed */
chmod(pathname, 0666);
return unlink(pathname);
}
#define unlink mingw_unlink
static inline int waitpid(pid_t pid, unsigned *status, unsigned options)
{
if (options == 0)