git:master:1ec69642: core: main.c - updates for shm unlock in shutdown cleanup

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

git:master:1ec69642: core: main.c - updates for shm unlock in shutdown cleanup

Daniel-Constantin Mierla-6
Module: kamailio
Branch: master
Commit: 1ec6964249dc5db4bd69c612b626466cae896c41
URL: https://github.com/kamailio/kamailio/commit/1ec6964249dc5db4bd69c612b626466cae896c41

Author: Daniel-Constantin Mierla <[hidden email]>
Committer: Daniel-Constantin Mierla <[hidden email]>
Date: 2017-08-11T15:37:33+02:00

core: main.c - updates for shm unlock in shutdown cleanup

- test if shm was initialized before global unlock

---

Modified: src/main.c

---

Diff:  https://github.com/kamailio/kamailio/commit/1ec6964249dc5db4bd69c612b626466cae896c41.diff
Patch: https://github.com/kamailio/kamailio/commit/1ec6964249dc5db4bd69c612b626466cae896c41.patch

---

diff --git a/src/main.c b/src/main.c
index a98a35693f..b65b0020ca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -518,10 +518,11 @@ void cleanup(int show_status)
 
  /*clean-up*/
 #ifndef SHM_SAFE_MALLOC
- if (_shm_lock)
- shm_unlock(); /* hack: force-unlock the shared memory lock in case
- some process crashed and let it locked; this will
- allow an almost gracious shutdown */
+ if(shm_initialized()) {
+ /* force-unlock the shared memory lock in case some process crashed
+ * and let it locked; this will allow an almost gracious shutdown */
+ shm_global_unlock();
+ }
 #endif
  destroy_rpcs();
  destroy_modules();


_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Loading...