From 3ebb4b883370da9528b7482b8ba4ed9521f07553 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 27 Feb 2012 19:20:18 +0100 Subject: because of the high cost associated with fake symdir resolution, disable symbolic-links on Windows by default. Real symlinks (Vista+) as well as NTFS junctions (prior to Vista) do not require this parameter --- mysys/my_access.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'mysys/my_access.c') diff --git a/mysys/my_access.c b/mysys/my_access.c index 210946d50a8..d7d06f814d6 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -26,11 +26,6 @@ path Path to file amode Access method - DESCRIPTION - This function wraps the normal access method because the access - available in MSVCRT> +reports that filenames such as LPT1 and - COM1 are valid (they are but should not be so for us). - RETURN VALUES 0 ok -1 error (We use -1 as my_access is mapped to access on other platforms) @@ -38,12 +33,11 @@ int my_access(const char *path, int amode) { - WIN32_FILE_ATTRIBUTE_DATA fileinfo; - BOOL result; - - result= GetFileAttributesEx(path, GetFileExInfoStandard, &fileinfo); - if (! result || - (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) + DWORD attributes; + + attributes = GetFileAttributes(path); + if (attributes == INVALID_FILE_ATTRIBUTES || + (attributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) { my_errno= errno= EACCES; return -1; -- cgit v1.2.1