threads / patch / 18193

patchBrown paper bag fix for MinGW 64-bit stat

Subject: [PATCH] Brown paper bag fix for MinGW 64-bit stat

## tl;dr

4 messages between Mar 7, 2009 and Mar 7, 2009. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Johannes Schindelin· Mar 7, 2009, 14:37 UTC · lore

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 <johannes.schindelin@gmx.de>
---
	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(-)
Show changes to compat/mingw.h +1 −1
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
Johannes Sixt· Mar 7, 2009, 19:46 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Brown paper bag fix for MinGW 64-bit stat

On Samstag, 7. März 2009, Johannes Schindelin wrote:
Show 5 quoted lines
> 	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.

U-oh, you are right! I was 100% sure that I ran the test-suite suite with your earlier patch and it was all OK before I gave my ACK. But appearently I did something wrong because today I see the failure in t4200, too, and this fixes it, and it is the right thing to do.

> -#define stat64(x,y) mingw_lstat(x,y)
> +#define _stati64(x,y) mingw_lstat(x,y)
Acked-by: Johannes Sixt <j6t@kdbg.org>
-- Hannes
Junio C Hamano· Mar 7, 2009, 20:00 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Brown paper bag fix for MinGW 64-bit stat

Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 12 quoted lines
> 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 <johannes.schindelin@gmx.de>

Since this is a fix-up to a new on 'master', I've applied the patch myself, but how would we want to handle MinGW related patches in general?

My preference is to have somebody I can rely on receiving Acked forwards from (or pulling from).

Johannes Schindelin· Mar 7, 2009, 21:02 UTC · re: Junio C Hamano · lore

Re: [PATCH] Brown paper bag fix for MinGW 64-bit stat

Hi,
On Sat, 7 Mar 2009, Junio C Hamano wrote:
Show 20 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> 
> > 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 <johannes.schindelin@gmx.de>
> 
> Since this is a fix-up to a new on 'master', I've applied the patch
> myself, but how would we want to handle MinGW related patches in general?
> 
> My preference is to have somebody I can rely on receiving Acked forwards
> from (or pulling from).
My preference is to keep the tried and tested mingw.git maintainer... ;-)
Note: IMHO Windows support is really at most beta quality; I would prefer 
only those using it who can fix bugs themselves, or have the means to make 
others fix the bugs.

So technically, we do not need such a strict and rigid process as for git.git itself, which is blessed with hundreds of contributors, due to which is really is ready for the end-user.

Ciao, Dscho

← back to recent threads