*** empty log message ***
This commit is contained in:
parent
8f8715e27b
commit
47cc4a9f83
2 changed files with 30 additions and 1 deletions
|
@ -13,7 +13,7 @@ int msgQueueElemAdd(msgQueue * queue, msgQueueElemId newElemId){
|
|||
goto ERROR;
|
||||
}
|
||||
strcpy(queueNewTailElem->next,newElemId);
|
||||
if (msgQueueElemClose(queueNewTailElem)){
|
||||
if (msgQueueElemClose(queueNewTailElem) <0 ){
|
||||
NZG_ERROR("msgQueueElemClose",newElemId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
|
29
src/queueRem.c
Normal file
29
src/queueRem.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "libnazgul.h"
|
||||
|
||||
// l'id de l'element enlevé vas dans oldElemId
|
||||
|
||||
int msgQueueElemRem(msgQueue * queue, msgQueueElemId oldElemId){
|
||||
msgQueueElem * queueOldHeadElem;
|
||||
|
||||
if (strcmp(queue->headId,queue->tailId)==0){
|
||||
NZG_ERROR("msgQueueElemRem : Empty queue",queue->id);
|
||||
goto ERROR;
|
||||
}
|
||||
strcpy(oldElemId,queue->headId);
|
||||
|
||||
queueOldHeadElem=msgQueueElemOpen(oldElemId);
|
||||
if (queueOldHeadElem == NULL){
|
||||
NZG_ERROR("msgQueueElemOpen",oldElemId);
|
||||
goto ERROR;
|
||||
}
|
||||
strcpy(queue->headId,queueOldHeadElem->next);
|
||||
if (msgQueueElemClose(queueOldHeadElem)<0 ){
|
||||
NZG_ERROR("msgQueueElemClose",oldElemId);
|
||||
goto ERROR;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
ERROR:
|
||||
return -1;
|
||||
}
|
Loading…
Reference in a new issue