[sr-dev] git:master: lock_ops.h: logging: convert LOG to LM_*
Ovidiu Sas
osas at voipembedded.com
Fri Oct 3 23:20:48 CEST 2014
Module: sip-router
Branch: master
Commit: 5f1205c8c98ea508d60830de48a2b43eb14f28e3
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5f1205c8c98ea508d60830de48a2b43eb14f28e3
Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date: Fri Oct 3 17:20:41 2014 -0400
lock_ops.h: logging: convert LOG to LM_*
---
lock_ops.h | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/lock_ops.h b/lock_ops.h
index f83ea77..097d5bb 100644
--- a/lock_ops.h
+++ b/lock_ops.h
@@ -225,8 +225,7 @@ tryagain:
DBG("lock_get: signal received while waiting for on a mutex\n");
goto tryagain;
}else{
- LOG(L_CRIT, "ERROR: lock_get sysv: %s (%d)\n", strerror(errno),
- errno);
+ LM_CRIT("sysv: %s (%d)\n", strerror(errno), errno);
return -1;
}
}
@@ -246,8 +245,7 @@ tryagain:
DBG("lock_get: signal received while waiting for on a mutex\n");
goto tryagain;
}else{
- LOG(L_CRIT, "ERROR: lock_get sysv: %s (%d)\n", strerror(errno),
- errno);
+ LM_CRIT("sysv: %s (%d)\n", strerror(errno), errno);
}
}
}
@@ -266,8 +264,7 @@ tryagain:
DBG("lock_release: signal received while releasing a mutex\n");
goto tryagain;
}else{
- LOG(L_CRIT, "ERROR: lock_release sysv: %s (%d)\n",
- strerror(errno), errno);
+ LM_CRIT("sysv: %s (%d)\n", strerror(errno), errno);
}
}
}
@@ -336,16 +333,14 @@ inline static gen_lock_set_t* lock_set_init(gen_lock_set_t* s)
if (uid && uid!=euid)
seteuid(euid); /* restore euid */
if (s->semid==-1){
- LOG(L_CRIT, "ERROR: lock_set_init (SYSV): semget (..., %d, 0700)"
- " failed: %s\n",
+ LM_CRIT("(SYSV): semget (..., %d, 0700) failed: %s\n",
s->size, strerror(errno));
return 0;
}
su.val=1;
for (r=0; r<s->size; r++){
if (semctl(s->semid, r, SETVAL, su)==-1){
- LOG(L_CRIT, "ERROR: lock_set_init (SYSV): semctl failed on sem %d"
- ": %s\n", r, strerror(errno));
+ LM_CRIT("(SYSV): semctl failed on sem %d: %s\n", r, strerror(errno));
semctl(s->semid, 0, IPC_RMID, (union semun)(int)0);
return 0;
}
@@ -375,8 +370,7 @@ tryagain:
DBG("lock_get: signal received while waiting for on a mutex\n");
goto tryagain;
}else{
- LOG(L_CRIT, "ERROR: lock_get sysv: %s (%d)\n", strerror(errno),
- errno);
+ LM_CRIT("sysv: %s (%d)\n", strerror(errno), errno);
return -1;
}
}
@@ -396,8 +390,7 @@ tryagain:
DBG("lock_set_get: signal received while waiting on a mutex\n");
goto tryagain;
}else{
- LOG(L_CRIT, "ERROR: lock_set_get sysv: %s (%d)\n",
- strerror(errno), errno);
+ LM_CRIT("sysv: %s (%d)\n", strerror(errno), errno);
}
}
}
@@ -415,8 +408,7 @@ tryagain:
DBG("lock_set_release: signal received while releasing mutex\n");
goto tryagain;
}else{
- LOG(L_CRIT, "ERROR: lock_set_release sysv: %s (%d)\n",
- strerror(errno), errno);
+ LM_CRIT("sysv: %s (%d)\n", strerror(errno), errno);
}
}
}
More information about the sr-dev
mailing list