1- /* Copyright (C) 2000 MySQL AB
1+ /* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
22
33 This program is free software; you can redistribute it and/or modify
44 it under the terms of the GNU General Public License as published by
@@ -339,10 +339,10 @@ static my_bool my_read_charset_file(const char *filename, myf myflags)
339339 !(buf = (uchar * ) my_malloc (len ,myflags )))
340340 return TRUE;
341341
342- if ((fd = my_open ( filename ,O_RDONLY ,myflags )) < 0 )
342+ if ((fd = mysql_file_open ( key_file_charset , filename , O_RDONLY , myflags )) < 0 )
343343 goto error ;
344- tmp_len = my_read (fd , buf , len , myflags );
345- my_close (fd ,myflags );
344+ tmp_len = mysql_file_read (fd , buf , len , myflags );
345+ mysql_file_close (fd , myflags );
346346 if (tmp_len != len )
347347 goto error ;
348348
@@ -421,7 +421,7 @@ static my_bool init_available_charsets(myf myflags)
421421 To make things thread safe we are not allowing other threads to interfere
422422 while we may changing the cs_info_table
423423 */
424- pthread_mutex_lock (& THR_LOCK_charset );
424+ mysql_mutex_lock (& THR_LOCK_charset );
425425 if (!charset_initialized )
426426 {
427427 bzero (& all_charsets ,sizeof (all_charsets ));
@@ -444,7 +444,7 @@ static my_bool init_available_charsets(myf myflags)
444444 error = my_read_charset_file (fname ,myflags );
445445 charset_initialized = 1 ;
446446 }
447- pthread_mutex_unlock (& THR_LOCK_charset );
447+ mysql_mutex_unlock (& THR_LOCK_charset );
448448 }
449449 return error ;
450450}
@@ -507,7 +507,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
507507 To make things thread safe we are not allowing other threads to interfere
508508 while we may changing the cs_info_table
509509 */
510- pthread_mutex_lock (& THR_LOCK_charset );
510+ mysql_mutex_lock (& THR_LOCK_charset );
511511
512512 if (!(cs -> state & (MY_CS_COMPILED |MY_CS_LOADED ))) /* if CS is not in memory */
513513 {
@@ -529,7 +529,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
529529 else
530530 cs = NULL ;
531531
532- pthread_mutex_unlock (& THR_LOCK_charset );
532+ mysql_mutex_unlock (& THR_LOCK_charset );
533533 }
534534 return cs ;
535535}
0 commit comments