diff options
Diffstat (limited to 'sql/sql_map.cc')
-rw-r--r-- | sql/sql_map.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 7f77ce1212d..e4e85c51d17 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2001, 2004-2005 MySQL AB +/* Copyright (C) 2000-2001, 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,10 +32,10 @@ mapped_files::mapped_files(const char * filename,uchar *magic,uint magic_length) error=0; map=0; size=0; - if ((file=my_open(name,O_RDONLY,MYF(MY_WME))) >= 0) + if ((file= mysql_file_open(key_file_map, name, O_RDONLY, MYF(MY_WME))) >= 0) { struct stat stat_buf; - if (!fstat(file,&stat_buf)) + if (!fstat(file, &stat_buf)) { if (!(map=(uchar*) my_mmap(0,(size_t)(size= stat_buf.st_size),PROT_READ, MAP_SHARED | MAP_NORESERVE,file, @@ -53,7 +53,7 @@ mapped_files::mapped_files(const char * filename,uchar *magic,uint magic_length) } if (!map) { - (void) my_close(file,MYF(0)); + (void) mysql_file_close(file, MYF(0)); file= -1; } } @@ -67,7 +67,7 @@ mapped_files::~mapped_files() if (file >= 0) { (void) my_munmap((char*) map,(size_t)size); - (void) my_close(file,MYF(0)); + (void) mysql_file_close(file, MYF(0)); file= -1; map=0; } my_free(name,MYF(0)); @@ -85,7 +85,7 @@ static I_List<mapped_files> maps_in_use; mapped_files *map_file(const char * name,uchar *magic,uint magic_length) { #ifdef HAVE_MMAP - pthread_mutex_lock(&LOCK_mapped_file); + mysql_mutex_lock(&LOCK_mapped_file); I_List_iterator<mapped_files> list(maps_in_use); mapped_files *map; char path[FN_REFLEN]; @@ -108,7 +108,7 @@ mapped_files *map_file(const char * name,uchar *magic,uint magic_length) if (!map->map) my_error(ER_NO_FILE_MAPPING, MYF(0), path, map->error); } - pthread_mutex_unlock(&LOCK_mapped_file); + mysql_mutex_unlock(&LOCK_mapped_file); return map; #else return NULL; @@ -122,10 +122,10 @@ mapped_files *map_file(const char * name,uchar *magic,uint magic_length) void unmap_file(mapped_files *map) { #ifdef HAVE_MMAP - pthread_mutex_lock(&LOCK_mapped_file); + mysql_mutex_lock(&LOCK_mapped_file); if (!map->use_count--) delete map; - pthread_mutex_unlock(&LOCK_mapped_file); + mysql_mutex_unlock(&LOCK_mapped_file); #endif } |