summaryrefslogtreecommitdiff
path: root/smsd/services/sql.c
diff options
context:
space:
mode:
authorMichal Čihař <nijel@debian.org>2016-10-23 14:49:40 +0200
committerMichal Čihař <nijel@debian.org>2016-10-23 14:49:40 +0200
commit34ae14a6a6c175b7e5dbcab86dbbde10c45f0122 (patch)
tree20988a61554879faae62ede58678232dcaaa3a69 /smsd/services/sql.c
parentd5dd432cc277a2fc89e59ef2d405307af81350c1 (diff)
parent4293c6165a17103edbdacb9971a8724bba275d32 (diff)
Merge tag 'upstream/1.37.91'
Upstream version 1.37.91 # gpg: Podpis vytvořen Ne 23. říjen 2016, 14:49:40 CEST # gpg: použití RSA klíče F4AA229D4D58C245 # gpg: Dobrý podpis od „Michal Čihař <michal@cihar.com>“ [absolutní] # gpg: alias „Michal Čihař <nijel@debian.org>“ [absolutní] # gpg: alias „[jpeg image of size 8848]“ [absolutní]
Diffstat (limited to 'smsd/services/sql.c')
-rw-r--r--smsd/services/sql.c21
1 files changed, 15 insertions, 6 deletions
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;