diff options
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_keycache.c | 6 | ||||
-rw-r--r-- | mysys/mf_pack.c | 2 | ||||
-rw-r--r-- | mysys/my_alloc.c | 2 | ||||
-rw-r--r-- | mysys/my_init.c | 2 | ||||
-rw-r--r-- | mysys/my_symlink.c | 12 | ||||
-rw-r--r-- | mysys/thr_lock.c | 2 |
6 files changed, 14 insertions, 12 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index f27ade7bfc0..0720d172317 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1382,7 +1382,7 @@ restart: /* We don't need the page in the cache: we are going to write on disk */ hash_link->requests--; unlink_hash(keycache, hash_link); - return 0; + DBUG_RETURN(0); } if (!(block->status & BLOCK_IN_FLUSH)) { @@ -1399,7 +1399,7 @@ restart: flag (see the code below that handles reading requests). */ free_block(keycache, block); - return 0; + DBUG_RETURN(0); } /* Wait intil the page is flushed on disk */ hash_link->requests--; @@ -1429,7 +1429,7 @@ restart: /* Invalidate page in the block if it has not been done yet */ if (block->status) free_block(keycache, block); - return 0; + DBUG_RETURN(0); } if (page_status == PAGE_READ && diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index 915c11ec51d..0157a65311a 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -343,7 +343,7 @@ uint unpack_dirname(my_string to, const char *from) length-=(uint) (suffix-buff)-1; if (length+(h_length= (uint) strlen(tilde_expansion)) <= FN_REFLEN) { - if (tilde_expansion[h_length-1] == FN_LIBCHAR) + if ((h_length > 0) && (tilde_expansion[h_length-1] == FN_LIBCHAR)) h_length--; if (buff+h_length < suffix) bmove(buff+h_length,suffix,length); diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 5983a29a3e1..99b5aec7eea 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -202,7 +202,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) { if (mem_root->error_handler) (*mem_root->error_handler)(); - return((gptr) 0); /* purecov: inspected */ + DBUG_RETURN((gptr) 0); /* purecov: inspected */ } mem_root->block_num++; next->next= *prev; diff --git a/mysys/my_init.c b/mysys/my_init.c index 8154a5fce51..07469e48e6c 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -305,8 +305,6 @@ static void my_win_init(void) const char *targetKey = "Software\\MySQL" ; DBUG_ENTER("my_win_init"); - setlocale(LC_CTYPE, ""); /* To get right sortorder */ - #if defined(_MSC_VER) #if _MSC_VER < 1300 /* diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c index 49c63fc3948..7f2be5644e8 100644 --- a/mysys/my_symlink.c +++ b/mysys/my_symlink.c @@ -106,12 +106,17 @@ int my_symlink(const char *content, const char *linkname, myf MyFlags) #define BUFF_LEN FN_LEN #endif + int my_is_symlink(const char *filename __attribute__((unused))) { -#if defined(HAVE_LSTAT) && defined(S_ISLNK) +#if defined (HAVE_LSTAT) && defined (S_ISLNK) struct stat stat_buff; return !lstat(filename, &stat_buff) && S_ISLNK(stat_buff.st_mode); -#else +#elif defined (_WIN32) + DWORD dwAttr = GetFileAttributes(filename); + return (dwAttr != INVALID_FILE_ATTRIBUTES) && + (dwAttr & FILE_ATTRIBUTE_REPARSE_POINT); +#else /* No symlinks */ return 0; #endif } @@ -128,7 +133,7 @@ int my_realpath(char *to, const char *filename, DBUG_PRINT("info",("executing realpath")); if ((ptr=realpath(filename,buff))) - strmake(to,ptr,FN_REFLEN-1); + strmake(to,ptr,FN_REFLEN-1); else { /* @@ -149,4 +154,3 @@ int my_realpath(char *to, const char *filename, 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; } |