On Monday 20 February 2012 13:44:54 Alon Bar-Lev wrote:
> This X_OK is standard define.
That's true for unixoid systems, but none of the [FWRX]_OK #defines exist in
the MS C runtime headers.
> It exists in mingw as 1.
Yeah, but only for legacy glue code reasons. From io.h:
----8<-------------
/* 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)
----8<-------------
> OpenVPN should not check execute if unsupported by OS, not changing
> standard constants.
> Where exactly is the problem?
Defining them makes code more readable, but without X_OK being 0 on Windows
openvpn crashes. See my commit message again and read the MSDN page about
_access at http://msdn.microsoft.com/en-us/library/1w06ktdy%28v=vs.100%29.aspx
Hence the change for the MSVC buildsystem only. Mingw handles the situation
internally already.
Hope that made it clear.
Heiko
--
Heiko Hund | Software Engineer | Phone +49-721-25516-237 | Fax -200
Astaro a Sophos Company | Amalienbadstr. 41 Bau 52 | 76227 Karlsruhe | Germany
Commercial Register: Mannheim HRA 702710 | Headquarter Location: Karlsruhe
Represented by the General Partner Astaro Verwaltungs GmbH
Amalienbadstraße 41 Bau 52 | 76227 Karlsruhe | Germany
Commercial Register: Mannheim HRB 708248 | Executive Board: Gert Hansen,
Markus Hennig, Jan Hichert, Günter Junk, Dr. Frank Nellissen