Module: kamailio
Branch: master
Commit: 9d316f2d0d2744c956e85a3619f6e39852aca20f
URL: 
https://github.com/kamailio/kamailio/commit/9d316f2d0d2744c956e85a3619f6e39852aca20f

Author: Henning Westerholt <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2020-02-13T23:08:35+01:00

tsilo: convert to memory logging helper

---

Modified: src/modules/tsilo/ts_hash.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/9d316f2d0d2744c956e85a3619f6e39852aca20f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9d316f2d0d2744c956e85a3619f6e39852aca20f.patch

---

diff --git a/src/modules/tsilo/ts_hash.c b/src/modules/tsilo/ts_hash.c
index 5532dfd52d..26f0097c6b 100644
--- a/src/modules/tsilo/ts_hash.c
+++ b/src/modules/tsilo/ts_hash.c
@@ -74,7 +74,7 @@ int init_ts_table(unsigned int size)
 
        t_table = (struct ts_table*)shm_malloc( sizeof(struct ts_table));
        if (t_table==0) {
-               LM_ERR("no more shm mem (1)\n");
+               SHM_MEM_ERROR;
                return -1;
        }
 
@@ -104,7 +104,7 @@ int init_ts_table(unsigned int size)
 
        t_table->entries = (ts_entry_t*)shm_malloc(sizeof(ts_entry_t) * size);
        if (!t_table->entries) {
-               LM_ERR("no more shm mem (2)\n");
+               SHM_MEM_ERROR;
                goto error;
        }
 
@@ -210,14 +210,14 @@ int new_ts_urecord(str* ruri, ts_urecord_t** _r)
 {
        *_r = (ts_urecord_t*)shm_malloc(sizeof(ts_urecord_t));
        if (*_r == 0) {
-               LM_ERR("no more share memory\n");
+               SHM_MEM_ERROR;
                return -1;
        }
        memset(*_r, 0, sizeof(ts_urecord_t));
 
        (*_r)->ruri.s = (char*)shm_malloc(ruri->len);
        if ((*_r)->ruri.s == 0) {
-               LM_ERR("no more share memory\n");
+               SHM_MEM_ERROR;
                shm_free(*_r);
                *_r = 0;
                return -2;
@@ -362,7 +362,7 @@ ts_transaction_t* new_ts_transaction(int tindex, int tlabel)
        len = sizeof(ts_transaction_t);
        ts = (ts_transaction_t*)shm_malloc(len);
        if (ts==0) {
-               LM_ERR("no more shm mem (%d)\n",len);
+               SHM_MEM_ERROR_FMT("len %d\n", len);
                return 0;
        }
 
@@ -388,7 +388,7 @@ ts_transaction_t* clone_ts_transaction(ts_transaction_t* ts)
        len = sizeof(ts_transaction_t);
        ts_clone = (ts_transaction_t*)shm_malloc(len);
        if (ts_clone==NULL) {
-               LM_ERR("no more shm mem (%d)\n",len);
+               SHM_MEM_ERROR_FMT("len %d\n", len);
                return NULL;
        }
 


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

Reply via email to