فهرست منبع

sca: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)
Henning Westerholt 6 سال پیش
والد
کامیت
9da33cd921
1فایلهای تغییر یافته به همراه2 افزوده شده و 5 حذف شده
  1. 2 5
      src/modules/sca/sca.c

+ 2 - 5
src/modules/sca/sca.c

@@ -222,11 +222,8 @@ static int sca_bind_srdb1(sca_mod *scam, db_func_t *db_api)
 
 	if (db_check_table_version(db_api, db_con, scam->cfg->subs_table,
 			SCA_DB_SUBSCRIPTIONS_TABLE_VERSION) < 0) {
-		LM_ERR("Version check of %.*s table in DB %.*s failed\n",
-				STR_FMT(scam->cfg->subs_table), STR_FMT(scam->cfg->db_url));
-		LM_ERR("%.*s table version %d required\n",
-				STR_FMT(scam->cfg->subs_table),
-				SCA_DB_SUBSCRIPTIONS_TABLE_VERSION);
+		str tmp = *scam->cfg->subs_table;
+		DB_TABLE_VERSION_ERROR(tmp);
 		goto done;
 	}