diff options
author | unknown <hery.ramilison@oracle.com> | 2011-07-06 01:13:50 +0200 |
---|---|---|
committer | MySQL Release Engineering <mysql-re_ww@oracle.com> | 2011-07-06 01:13:50 +0200 |
commit | 7d605ec45f8e55e1775fd028931c459e6501d25a (patch) | |
tree | 31e14059cf5a1e5e8c1601a2488b98c4af1bfeb0 /mysys/my_symlink.c | |
parent | 8f73e64fff57fe4080cfc4d2816555b0d22b9e13 (diff) | |
parent | 8b1566aaaf93e6e885badd6500a07a0f70cc81f3 (diff) | |
download | mariadb-git-7d605ec45f8e55e1775fd028931c459e6501d25a.tar.gz |
Merge from mysql-5.5.14-release
Diffstat (limited to 'mysys/my_symlink.c')
-rw-r--r-- | mysys/my_symlink.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c index be8d6e63366..37e7a754347 100644 --- a/mysys/my_symlink.c +++ b/mysys/my_symlink.c @@ -144,24 +144,23 @@ int my_realpath(char *to, const char *filename, myf MyFlags) result= -1; } DBUG_RETURN(result); -#else -#ifdef _WIN32 - int ret= GetFullPathName(filename,FN_REFLEN,
- to,
- NULL); +#elif defined(_WIN32) + int ret= GetFullPathName(filename,FN_REFLEN, to, NULL); if (ret == 0 || ret > FN_REFLEN) { - if (ret > FN_REFLEN) - my_errno= ENAMETOOLONG; - else - my_errno= EACCES; + my_errno= (ret > FN_REFLEN) ? ENAMETOOLONG : GetLastError(); if (MyFlags & MY_WME) my_error(EE_REALPATH, MYF(0), filename, my_errno); - return -1; + /* + GetFullPathName didn't work : use my_load_path() which is a poor + substitute original name but will at least be able to resolve + paths that starts with '.'. + */ + my_load_path(to, filename, NullS); + return -1; } #else my_load_path(to, filename, NullS); #endif return 0; -#endif } |