sqlops: fix reversed logic in db re-connecting handling (GH #1821)
authorHenning Westerholt <hw@skalatan.de>
Fri, 5 Apr 2019 09:03:51 +0000 (11:03 +0200)
committerHenning Westerholt <hw@skalatan.de>
Fri, 5 Apr 2019 09:03:51 +0000 (11:03 +0200)
src/modules/sqlops/sql_api.c

index 87c4f2f..f39da7f 100644 (file)
@@ -161,7 +161,7 @@ int sql_connect(int mode)
                sc->dbh = sc->dbf.init(&sc->db_url);
                if (sc->dbh==NULL)
                {
-                       if(mode) {
+                       if(!mode) {
                                LM_ERR("failed to connect to the database [%.*s]\n",
                                                sc->name.len, sc->name.s);
                                return -1;