@@ -4462,7 +4462,9 @@ bool MYSQL_BIN_LOG::flush_and_sync(const bool force)
44624462 if (flush_io_cache (&log_file))
44634463 return 1 ;
44644464
4465- return sync_binlog_file (true , 0 );
4465+ std::pair<bool , bool > result= sync_binlog_file (true );
4466+
4467+ return result.first ;
44664468}
44674469
44684470void MYSQL_BIN_LOG::start_union_events (THD *thd, query_id_t query_id_param)
@@ -6011,21 +6013,19 @@ MYSQL_BIN_LOG::flush_cache_to_file(my_off_t *end_pos_var)
60116013/* *
60126014 Call fsync() to sync the file to disk.
60136015*/
6014- int
6015- MYSQL_BIN_LOG::sync_binlog_file (bool force, bool *synced )
6016+ std::pair< bool , bool >
6017+ MYSQL_BIN_LOG::sync_binlog_file (bool force)
60166018{
6019+ bool synced= false ;
60176020 unsigned int sync_period= get_sync_period ();
6018- if (synced)
6019- *synced= false ;
60206021 if (force || (sync_period && ++sync_counter >= sync_period))
60216022 {
60226023 sync_counter= 0 ;
60236024 if (mysql_file_sync (log_file.file , MYF (MY_WME)))
6024- return ER_ERROR_ON_WRITE;
6025- if (synced)
6026- *synced= true ;
6025+ return std::make_pair (true , synced);
6026+ synced= true ;
60276027 }
6028- return 0 ;
6028+ return std::make_pair ( false , synced) ;
60296029}
60306030
60316031
@@ -6182,7 +6182,11 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit)
61826182 THD *final_queue= stage_manager.fetch_queue_for (Stage_manager::SYNC_STAGE);
61836183 bool synced= false ;
61846184 if (flush_error == 0 && total_bytes > 0 )
6185- flush_error= sync_binlog_file (false , &synced);
6185+ {
6186+ std::pair<bool , bool > result= sync_binlog_file (false );
6187+ flush_error= result.first ;
6188+ synced= result.second ;
6189+ }
61866190
61876191 /*
61886192 If the sync finished successfully, we can call the after_flush
0 commit comments