Merge branch 'hv/mingw-fs-funnies'
authorJunio C Hamano <gitster@pobox.com>
Mon, 28 Feb 2011 05:17:37 +0000 (21:17 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Feb 2011 05:17:37 +0000 (21:17 -0800)
* 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

1  2 
compat/mingw.h
diff --combined compat/mingw.h
index cafc1eb08a71dd60566a7389ed606e777cf17fc8,8b159c44476efd7c7830d87cc5a5ec3dea6818c0..fe6ba340437b67237afd8cfdb4cf2a20074d27f7
@@@ -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