Module: sip-router
Branch: janakj/postgres
Commit: 89143e1d58105a293193d92b132534295be4e717
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=89143e1…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu Feb 22 15:56:48 2007 +0000
- fix the yesterday's fix: allow db_init from main if it's done from mod_init
(but don't allow it and log a BUG if it happens from child_init(PROC_MAIN)).
(SER-227 related)
---
modules/db_postgres/dbase.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/db_postgres/dbase.c b/modules/db_postgres/dbase.c
index 0305efa..17a86d5 100644
--- a/modules/db_postgres/dbase.c
+++ b/modules/db_postgres/dbase.c
@@ -40,6 +40,7 @@
#include "../../db/db_pool.h"
#include "../../ut.h"
#include "../../globals.h"
+#include "../../pt.h"
#include "pg_con.h"
#include "pg_type.h"
#include "db_mod.h"
@@ -228,7 +229,8 @@ db_con_t* pg_init(const char* url)
id = 0;
res = 0;
- if (is_main){
+ /* if called from PROC_MAIN, allow it only from mod_init( when pt==0)*/
+ if (is_main && pt){
LOG(L_ERR, "BUG: postgres: pg_init: called from the main process,"
" ignoring...\n");
return 0;