Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2007-12-08 00:19:40 +0300
committerJohannes Sixt <johannes.sixt@telecom.at>2008-06-23 15:40:18 +0400
commitea9e98c3a54d3b693367fbb8c87812b17ad95869 (patch)
treecc4abaa44db9b3067917c2d20c29929d2f9005c1 /compat/mingw.h
parent132a6e903fd912d02392db55c407267103766f19 (diff)
Windows: Work around misbehaved rename().
Windows's rename() is based on the MoveFile() API, which fails if the destination exists. Here we work around the problem by using MoveFileEx(). Furthermore, the posixly correct error is returned if the destination is a directory. The implementation is still slightly incomplete, however, because of the missing error code translation: We assume that the failure is due to permissions. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Diffstat (limited to 'compat/mingw.h')
-rw-r--r--compat/mingw.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 95a08b4128..46fd8da06e 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -151,6 +151,9 @@ int mingw_open (const char *filename, int oflags, ...);
char *mingw_getcwd(char *pointer, int len);
#define getcwd mingw_getcwd
+int mingw_rename(const char*, const char*);
+#define rename mingw_rename
+
/*
* git specific compatibility
*/