summaryrefslogtreecommitdiff
path: root/compat/mingw.h
diff options
context:
space:
mode:
authorHeiko Voigt <hvoigt@hvoigt.net>2011-02-07 21:49:33 +0100
committerJunio C Hamano <gitster@pobox.com>2011-02-07 15:45:54 -0800
commit337967fb7794b300f1633a413c0db525ab517a3e (patch)
treed871be95ea017e4941687b6c387f0a8d0830e9b9 /compat/mingw.h
parentb5c178143088350c49129acbedb864d70c666215 (diff)
downloadgit-337967fb7794b300f1633a413c0db525ab517a3e.tar.gz
mingw: move unlink wrapper to mingw.c
The next patch implements a workaround in case unlink fails on Windows. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.h')
-rw-r--r--compat/mingw.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 2283071109..8316938020 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -125,14 +125,6 @@ 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
-
#define WNOHANG 1
pid_t waitpid(pid_t pid, int *status, unsigned options);
@@ -180,6 +172,9 @@ int link(const char *oldpath, const char *newpath);
* replacements of existing functions
*/
+int mingw_unlink(const char *pathname);
+#define unlink mingw_unlink
+
int mingw_open (const char *filename, int oflags, ...);
#define open mingw_open