summaryrefslogtreecommitdiff
path: root/src/common/sql.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-12-26 02:28:59 +0100
committerHaru <haru@dotalux.com>2016-05-08 19:53:57 +0200
commit2349b2a1528fe5dc41d930f8dd332df5ba521eb6 (patch)
tree3656a91a896f0ef090606b2b4c9184ad73153a3f /src/common/sql.c
parent58a7bf46508b7f186704e7efb39576e09f0ab866 (diff)
downloadhercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.gz
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.bz2
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.tar.xz
hercules-2349b2a1528fe5dc41d930f8dd332df5ba521eb6.zip
Fixed various issues pointed out by cppcheck
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/sql.c')
-rw-r--r--src/common/sql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/sql.c b/src/common/sql.c
index 1eae1b29b..ef8cde536 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -880,10 +880,10 @@ void SqlStmt_Free(struct SqlStmt *self)
}
/* receives mysql error codes during runtime (not on first-time-connects) */
void hercules_mysql_error_handler(unsigned int ecode) {
- static unsigned int retry = 1;
switch( ecode ) {
case 2003:/* Can't connect to MySQL (this error only happens here when failing to reconnect) */
if( mysql_reconnect_type == 1 ) {
+ static unsigned int retry = 1;
if( ++retry > mysql_reconnect_count ) {
ShowFatalError("MySQL has been unreachable for too long, %u reconnects were attempted. Shutting Down\n", retry);
exit(EXIT_FAILURE);