l3.libnazgul/src/queueDelete.c

27 lines
499 B
C
Raw Normal View History

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