Re: [MinGW PATCH] Fixed error 'fatal: Not a git repository' on Vista
- From
- Marco Roeland <marco.roeland@xs4all.nl>
- Date
- Aug 16, 2007, 09:56 UTC
- Message-ID
- <20070816095655.GA13069@fiberbit.xs4all.nl>
- In-Reply-To
- <46C40CB3.5415D888@eudaptics.com>
On Thursday August 16th 2007 at 10:37 Johannes Sixt wrote:
> I don't see how this could make a difference: __USE_MINGW_ACCESS appears > in none of the mingw header files nor in the mingw.git sources. > > Is my build environment outdated?
The mingw patch for fixing this Vista regression (from Danny Smith on March 5th) is in mingw-runtime-3.12-1. It is in file <include/io.h> and works like this:
#ifdef __USE_MINGW_ACCESS
/* Old versions of MSVCRT access() just ignored X_OK, while the version
shipped with Vista, returns an error code. This will restore the
old behaviour */
static inline int __mingw_access (const char* __fname, int __mode)
{ return _access (__fname, __mode & ~X_OK); }
#define access(__f,__m) __mingw_access (__f, __m)
#endifWhenever the X_OK bit is set in the mode flag for access(2) Vista returns an error for the call. So yes, using __USE_MINGW_ACCESS will not work on older mingw versions. Defining X_OK to 0 for mingw might fix the problem for older versions.
-- Marco Roeland