Browse code

benchmark: use common error logging defines for memory allocation problems

Henning Westerholt authored on 20/06/2022 17:22:38
Showing 1 changed files
... ...
@@ -220,7 +220,7 @@ static int bm_init_mycfg(void)
220 220
 	}
221 221
 	bm_mycfg = (bm_cfg_t*)shm_malloc(sizeof(bm_cfg_t));
222 222
 	if(bm_mycfg==NULL) {
223
-		LM_ERR("failed to allocated shared memory\n");
223
+		SHM_MEM_ERROR;
224 224
 		return -1;
225 225
 	}
226 226
 	memset(bm_mycfg, 0, sizeof(bm_cfg_t));
... ...
@@ -407,7 +407,7 @@ int _bm_register_timer(char *tname, int mode, unsigned int *id)
407 407
 
408 408
 	if(bmt==0)
409 409
 	{
410
-		LM_ERR("no more shm\n");
410
+		SHM_MEM_ERROR;
411 411
 		return -1;
412 412
 	}
413 413
 	memset(bmt, 0, sizeof(benchmark_timer_t));
... ...
@@ -417,7 +417,7 @@ int _bm_register_timer(char *tname, int mode, unsigned int *id)
417 417
 	if(bmt->start == NULL)
418 418
 	{
419 419
 		shm_free(bmt);
420
-		LM_ERR("no more pkg\n");
420
+		PKG_MEM_ERROR;
421 421
 		return -1;
422 422
 	}
423 423
 	memset(bmt->start, 0, sizeof(bm_timeval_t));
... ...
@@ -442,7 +442,7 @@ int _bm_register_timer(char *tname, int mode, unsigned int *id)
442 442
 								sizeof(benchmark_timer_t*));
443 443
 		if(bm_mycfg->tindex==0)
444 444
 		{
445
-			LM_ERR("no more share memory\n");
445
+			SHM_MEM_ERROR;
446 446
 			if(tidx!=0)
447 447
 				shm_free(tidx);
448 448
 			return -1;