[sr-dev] git:master:dbd78eb8: tls: update log messages macros

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 10 17:05:47 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-04-10T17:04:58+02:00

tls: update log messages macros

---

Modified: src/modules/tls/tls_locking.c

---

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

---

diff --git a/src/modules/tls/tls_locking.c b/src/modules/tls/tls_locking.c
index 0e1e7d8..9d8e8ac 100644
--- a/src/modules/tls/tls_locking.c
+++ b/src/modules/tls/tls_locking.c
@@ -45,12 +45,12 @@ static struct CRYPTO_dynlock_value* dyn_create_f(const char* file, int line)
 
 	l=shm_malloc(sizeof(struct CRYPTO_dynlock_value));
 	if (l==0){
-		LOG(L_CRIT, "ERROR: tls: dyn_create_f locking callback out of shm."
+		LM_CRIT("dyn create locking callback out of shm."
 				" memory (called from %s:%d)\n", file, line);
 		goto error;
 	}
 	if (lock_init(&l->lock)==0){
-		LOG(L_CRIT, "ERROR: tls: dyn_create_f locking callback: lock "
+		LM_CRIT("dyn create locking callback: lock "
 				"initialization failed (called from %s:%d)\n", file, line);
 		shm_free(l);
 		goto error;
@@ -66,7 +66,7 @@ static void dyn_lock_f(int mode, struct CRYPTO_dynlock_value* l,
 						const char* file, int line)
 {
 	if (l==0){
-		LOG(L_CRIT, "BUG: tls: dyn_lock_f locking callback: null lock"
+		LM_CRIT("dyn lock locking callback: null lock"
 				" (called from %s:%d)\n", file, line);
 		/* try to continue */
 		return;
@@ -84,7 +84,7 @@ static void dyn_destroy_f(struct CRYPTO_dynlock_value *l,
 							const char* file, int line)
 {
 	if (l==0){
-		LOG(L_CRIT, "BUG: tls: dyn_destroy_f locking callback: null lock"
+		LM_CRIT("dyn destroy locking callback: null lock"
 				" (called from %s:%d)\n", file, line);
 		return;
 	}
@@ -98,7 +98,7 @@ static void dyn_destroy_f(struct CRYPTO_dynlock_value *l,
 static void locking_f(int mode, int n, const char* file, int line)
 {
 	if (n<0 || n>=n_static_locks){
-		LOG(L_CRIT, "BUG: tls: locking_f (callback): invalid lock number: "
+		LM_CRIT("locking (callback): invalid lock number: "
 				" %d (range 0 - %d), called from %s:%d\n",
 				n, n_static_locks, file, line);
 		abort(); /* quick crash :-) */
@@ -140,8 +140,7 @@ int tls_init_locks()
 	/* init "static" tls locks */
 	n_static_locks=CRYPTO_num_locks();
 	if (n_static_locks<0){
-		LOG(L_CRIT, "BUG: tls: tls_init_locking: bad CRYPTO_num_locks %d\n",
-					n_static_locks);
+		LM_CRIT("bad CRYPTO_num_locks %d\n", n_static_locks);
 		n_static_locks=0;
 	}
 	if (n_static_locks){
@@ -151,13 +150,12 @@ int tls_init_locks()
 		}
 		static_locks=lock_set_alloc(n_static_locks);
 		if (static_locks==0){
-			LOG(L_CRIT, "ERROR: tls_init_locking: could not allocate lockset"
-					" with %d locks\n", n_static_locks);
+			LM_CRIT("could not allocate lockset with %d locks\n",
+					n_static_locks);
 			goto error;
 		}
 		if (lock_set_init(static_locks)==0){
-			LOG(L_CRIT, "ERROR: tls_init_locking: lock_set_init failed "
-					"(%d locks)\n", n_static_locks);
+			LM_CRIT("lock set init failed (%d locks)\n", n_static_locks);
 			lock_set_dealloc(static_locks);
 			static_locks=0;
 			n_static_locks=0;




More information about the sr-dev mailing list