l3.libnazgul/src/queueElemDelete.c

27 lines
508 B
C
Raw Normal View History

2004-02-23 20:38:02 +00:00
#include "libnazgul.h"
int msgQueueElemDelete(msgQueueElemId queueElemId){
msgQueueElem * queueElemAddr;
msgQueueElemId nextIdToDie;
queueElemAddr = msgQueueElemOpen(queueElemId);
2019-09-17 12:49:28 +00:00
if (queueElemAddr==NULL){
NZG_ERROR("msgQueueElemOpen",queueElemId);
goto ERROR;
}
if (msgQueueElemClose(queueElemAddr) < 0){
NZG_ERROR("msgQueueElemClose",queueElemId);
goto ERROR;
}
2004-02-23 20:38:02 +00:00
if (nextIdToDie != NULL){
return msgQueueElemDelete(nextIdToDie);
} else {
return 0;
}
ERROR:
return -1;
}