1
- /* Copyright (C) 2000 MySQL AB
1
+ /* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
2
2
3
3
This program is free software; you can redistribute it and/or modify
4
4
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)
339
339
!(buf = (uchar * ) my_malloc (len ,myflags )))
340
340
return TRUE;
341
341
342
- if ((fd = my_open ( filename ,O_RDONLY ,myflags )) < 0 )
342
+ if ((fd = mysql_file_open ( key_file_charset , filename , O_RDONLY , myflags )) < 0 )
343
343
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 );
346
346
if (tmp_len != len )
347
347
goto error ;
348
348
@@ -421,7 +421,7 @@ static my_bool init_available_charsets(myf myflags)
421
421
To make things thread safe we are not allowing other threads to interfere
422
422
while we may changing the cs_info_table
423
423
*/
424
- pthread_mutex_lock (& THR_LOCK_charset );
424
+ mysql_mutex_lock (& THR_LOCK_charset );
425
425
if (!charset_initialized )
426
426
{
427
427
bzero (& all_charsets ,sizeof (all_charsets ));
@@ -444,7 +444,7 @@ static my_bool init_available_charsets(myf myflags)
444
444
error = my_read_charset_file (fname ,myflags );
445
445
charset_initialized = 1 ;
446
446
}
447
- pthread_mutex_unlock (& THR_LOCK_charset );
447
+ mysql_mutex_unlock (& THR_LOCK_charset );
448
448
}
449
449
return error ;
450
450
}
@@ -507,7 +507,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
507
507
To make things thread safe we are not allowing other threads to interfere
508
508
while we may changing the cs_info_table
509
509
*/
510
- pthread_mutex_lock (& THR_LOCK_charset );
510
+ mysql_mutex_lock (& THR_LOCK_charset );
511
511
512
512
if (!(cs -> state & (MY_CS_COMPILED |MY_CS_LOADED ))) /* if CS is not in memory */
513
513
{
@@ -529,7 +529,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
529
529
else
530
530
cs = NULL ;
531
531
532
- pthread_mutex_unlock (& THR_LOCK_charset );
532
+ mysql_mutex_unlock (& THR_LOCK_charset );
533
533
}
534
534
return cs ;
535
535
}
0 commit comments