From: Junio C Hamano Date: Mon, 28 Feb 2011 05:17:37 +0000 (-0800) Subject: Merge branch 'hv/mingw-fs-funnies' X-Git-Tag: v1.7.5-rc0~120 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/70ae2beadd45d1874ffbfba2d5c45ea9fd2af12c?ds=sidebyside;hp=-c Merge branch 'hv/mingw-fs-funnies' * hv/mingw-fs-funnies: mingw_rmdir: set errno=ENOTEMPTY when appropriate mingw: add fallback for rmdir in case directory is in use mingw: make failures to unlink or move raise a question mingw: work around irregular failures of unlink on windows mingw: move unlink wrapper to mingw.c --- 70ae2beadd45d1874ffbfba2d5c45ea9fd2af12c diff --combined compat/mingw.h index cafc1eb08a,8b159c4447..fe6ba34043 --- a/compat/mingw.h +++ b/compat/mingw.h @@@ -14,6 -14,12 +14,6 @@@ typedef int socklen_t #define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK) #define S_ISSOCK(x) 0 -#ifndef _STAT_H_ -#define S_IRUSR 0 -#define S_IWUSR 0 -#define S_IXUSR 0 -#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -#endif #define S_IRGRP 0 #define S_IWGRP 0 #define S_IXGRP 0 @@@ -119,14 -125,6 +119,6 @@@ static inline int mingw_mkdir(const cha } #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 - #define WNOHANG 1 pid_t waitpid(pid_t pid, int *status, unsigned options); @@@ -174,6 -172,12 +166,12 @@@ int link(const char *oldpath, const cha * replacements of existing functions */ + int mingw_unlink(const char *pathname); + #define unlink mingw_unlink + + int mingw_rmdir(const char *path); + #define rmdir mingw_rmdir + int mingw_open (const char *filename, int oflags, ...); #define open mingw_open