From: Johannes Schindelin Date: Sat, 07 Mar 2009 14:37:18 GMT Subject: [PATCH] Brown paper bag fix for MinGW 64-bit stat Message-ID: <03fcab37c921f5728deded11c07bdf32a263b79b.1236436185u.git.johannes.schindelin@gmx.de> In-Reply-To: When overriding the identifier "stat" so that "struct stat" will be substituted with "struct _stati64" everywhere, I tried to fix the calls to the _function_ stat(), too, but I forgot to change the earlier attempt "stat64" to "_stati64" there. So, the stat() calls were overridden by calls to _stati64() instead. Unfortunately, there is a function _stati64() so that I missed that calls to stat() were not actually overridden by calls to mingw_lstat(), but t4200-rerere.sh showed the error. Signed-off-by: Johannes Schindelin --- Aaargh. I am very, very sorry. Actually, it was quite funny that t4200 displayed the bug; I _guess_ it was due to a time zone issue, as the times were exactly one hour off (and the machine I tested on is at UTC+0100 right now). And due to that bug, "rerere gc" would not collect the garbage. So even if the C runtime provides a _stati64() function that pretends to work, it does not, and this patch is absolutely necessary. Now, if only the tests would not take ages to run on Windows... then I would not be tempted to skip them when sending the next patches. compat/mingw.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/compat/mingw.h b/compat/mingw.h index 92fb310..a0b74fb 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -169,7 +169,7 @@ int mingw_lstat(const char *file_name, struct stat *buf); int mingw_fstat(int fd, struct stat *buf); #define fstat mingw_fstat #define lstat mingw_lstat -#define stat64(x,y) mingw_lstat(x,y) +#define _stati64(x,y) mingw_lstat(x,y) int mingw_utime(const char *file_name, const struct utimbuf *times); #define utime mingw_utime -- 1.6.2.327.g0fa6c