summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5c1781)
raw | patch | inline | side by side (parent: b5c1781)
author | Heiko Voigt <hvoigt@hvoigt.net> | |
Mon, 7 Feb 2011 20:49:33 +0000 (21:49 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 7 Feb 2011 23:45:54 +0000 (15:45 -0800) |
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>
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index bee605441910caeddd1e94eb7795f615a3d1348a..a7e1c6b47148c042dd1eda87a6aa2b58c38a34e2 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
return error;
}
+#undef unlink
+int mingw_unlink(const char *pathname)
+{
+ /* read-only files cannot be removed */
+ chmod(pathname, 0666);
+ return unlink(pathname);
+}
+
#undef open
int mingw_open (const char *filename, int oflags, ...)
{
diff --git a/compat/mingw.h b/compat/mingw.h
index 228307110971c7b3259953730687c0e90b07a49c..8316938020beb556d6926e95dcd1b44a26669325 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
}
#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);
* 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