summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2008-08-26 13:32:43 +0500
committerAlexey Botchkov <holyfoot@mysql.com>2008-08-26 13:32:43 +0500
commite180ea955397368c86e0db527cb54956b8207933 (patch)
tree200730f9c3f71ec931278abde26c627495e4a758 /mysys
parent69aa70b63612529764de1232824853a4221c27b9 (diff)
parentc568f7ac6ef1932256d21c8d1f09ac07c9765627 (diff)
downloadmariadb-git-e180ea955397368c86e0db527cb54956b8207933.tar.gz
merging fix
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_symlink.c8
-rw-r--r--mysys/thr_lock.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index c07be41066f..7f2be5644e8 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -109,8 +109,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
}
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 02c9f08c946..853e1f96b49 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -333,10 +333,10 @@ void thr_lock_init(THR_LOCK *lock)
void thr_lock_delete(THR_LOCK *lock)
{
DBUG_ENTER("thr_lock_delete");
- VOID(pthread_mutex_destroy(&lock->mutex));
pthread_mutex_lock(&THR_LOCK_lock);
thr_lock_thread_list=list_delete(thr_lock_thread_list,&lock->list);
pthread_mutex_unlock(&THR_LOCK_lock);
+ pthread_mutex_destroy(&lock->mutex);
DBUG_VOID_RETURN;
}