--- mysql-5.1.43/sql/log.cc~ 2010-01-15 19:17:28.000000000 +0200 +++ mysql-5.1.43/sql/log.cc 2010-02-01 14:53:55.026725423 +0200 @@ -5020,11 +5042,11 @@ bool result=0; if (opt_error_log) { + VOID(pthread_mutex_lock(&LOCK_error_log)); +#ifdef __WIN__ char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-5); strmov(end, "-old"); - VOID(pthread_mutex_lock(&LOCK_error_log)); -#ifdef __WIN__ char err_temp[FN_REFLEN+5]; /* On Windows is necessary a temporary file for to rename @@ -5060,7 +5082,6 @@ else result= 1; #else - my_rename(log_error_file,err_renamed,MYF(0)); if (freopen(log_error_file,"a+",stdout)) { FILE *reopen;