[sr-dev] git:master: modules/presence: fix crash in main/ attendant process when using presence module in library mode

Jason Penton jason.penton at gmail.com
Thu Jan 23 16:26:19 CET 2014


Module: sip-router
Branch: master
Commit: 20302744b22858e0e215e74e2a6656677881bb4a
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=20302744b22858e0e215e74e2a6656677881bb4a

Author: Jason Penton <jason.penton at gmail.com>
Committer: Jason Penton <jason.penton at 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

---

 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 067a1e1..75e5da8 100644
--- a/modules/presence/presence.c
+++ b/modules/presence/presence.c
@@ -415,6 +415,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;
@@ -438,11 +443,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");




More information about the sr-dev mailing list