From 4293c6165a17103edbdacb9971a8724bba275d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 23 Oct 2016 14:49:34 +0200 Subject: New upstream version 1.37.91 --- smsd/services/sql.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'smsd/services/sql.c') diff --git a/smsd/services/sql.c b/smsd/services/sql.c index 34c2855..d3a0191 100644 --- a/smsd/services/sql.c +++ b/smsd/services/sql.c @@ -1314,24 +1314,33 @@ GSM_Error SMSDSQL_ReadConfiguration(GSM_SMSDConfig *Config) } Config->db = NULL; -#ifdef HAVE_MYSQL_MYSQL_H if (!strcasecmp(Config->driver, "native_mysql")) { +#ifdef HAVE_MYSQL_MYSQL_H Config->db = &SMSDMySQL; - } +#else + SMSD_Log(DEBUG_ERROR, Config, "The %s driver was not compiled in!", Config->driver); + return ERR_DISABLED; #endif -#ifdef HAVE_POSTGRESQL_LIBPQ_FE_H + } if (!strcasecmp(Config->driver, "native_pgsql")) { +#ifdef HAVE_POSTGRESQL_LIBPQ_FE_H Config->db = &SMSDPgSQL; - } +#else + SMSD_Log(DEBUG_ERROR, Config, "The %s driver was not compiled in!", Config->driver); + return ERR_DISABLED; #endif -#ifdef ODBC_FOUND + } if (!strcasecmp(Config->driver, "odbc")) { +#ifdef ODBC_FOUND Config->db = &SMSDODBC; if (Config->sql == NULL) { SMSD_Log(DEBUG_INFO, Config, "Using generic SQL for ODBC, this might fail. In such case please set SQL configuration option."); } - } +#else + SMSD_Log(DEBUG_ERROR, Config, "The %s driver was not compiled in!", Config->driver); + return ERR_DISABLED; #endif + } if (Config->db == NULL) { #ifdef LIBDBI_FOUND Config->db = &SMSDDBI; -- cgit v1.2.3