summaryrefslogtreecommitdiff
path: root/mysys/my_symlink.c
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2008-08-26 14:31:17 +0500
committerAlexey Botchkov <holyfoot@mysql.com>2008-08-26 14:31:17 +0500
commit27ca994dffe238a4e4489dba1ec72918dfcaf729 (patch)
treee486b05bb9f3e200ea0cc7531c47d3e5f845a356 /mysys/my_symlink.c
parentd30db4c9e9fe2f8d5d1e92afb060a88d54434ea2 (diff)
parent8d3eb141e08103c5119854948dd793ec55d3cc00 (diff)
downloadmariadb-git-27ca994dffe238a4e4489dba1ec72918dfcaf729.tar.gz
merging fixes
Diffstat (limited to 'mysys/my_symlink.c')
-rw-r--r--mysys/my_symlink.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index 69ce91ada5b..f8c6ebf02c3 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -111,8 +111,16 @@ int my_symlink(const char *content, const char *linkname, myf MyFlags)
int my_is_symlink(const char *filename __attribute__((unused)))
{
+#if defined (HAVE_LSTAT) && defined (S_ISLNK)
struct stat stat_buff;
return !lstat(filename, &stat_buff) && S_ISLNK(stat_buff.st_mode);
+#elif defined (_WIN32)
+ DWORD dwAttr = GetFileAttributes(filename);
+ return (dwAttr != INVALID_FILE_ATTRIBUTES) &&
+ (dwAttr & FILE_ATTRIBUTE_REPARSE_POINT);
+#else /* No symlinks */
+ return 0;
+#endif
}