Module: sip-router
Branch: 4.1
Commit: b64064b15759217821d936732e2da0c129cf89d1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b64064b…
Author: Jason Penton <jason.penton(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Jan 23 17:25:04 2014 +0200
modules/presence: fix crash in main/attendant process when using presence module in
library mode
(cherry picked from commit 20302744b22858e0e215e74e2a6656677881bb4a)
---
modules/presence/presence.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/presence/presence.c b/modules/presence/presence.c
index 6a87776..a35fcec 100644
--- a/modules/presence/presence.c
+++ b/modules/presence/presence.c
@@ -422,6 +422,11 @@ static int child_init(int rank)
if (rank==PROC_INIT || rank==PROC_TCP_MAIN)
return 0;
+ pid = my_pid();
+
+ if(library_mode)
+ return 0;
+
if (rank == PROC_MAIN)
{
int i;
@@ -445,11 +450,6 @@ static int child_init(int rank)
return 0;
}
- pid = my_pid();
-
- if(library_mode)
- return 0;
-
if (pa_dbf.init==0)
{
LM_CRIT("child_init: database not bound\n");