28 lines
517 B
C
28 lines
517 B
C
#include "libnazgul.h"
|
|
|
|
int msgQueueElemDelete(msgQueueElemId queueElemId){
|
|
msgQueueElem * queueElemAddr;
|
|
msgQueueElemId nextIdToDie;
|
|
|
|
|
|
queueElemAddr = msgQueueElemOpen(queueElemId);
|
|
strcpy(nextIdToDie,queueElemAddr->id);
|
|
msgQueueElemClose(queueElemAddr);
|
|
|
|
if (shm_unlink(queueElemId) < 0){
|
|
NZG_ERROR("shm_unlink msgQueueElem",queueElemId);
|
|
goto ERROR;
|
|
}
|
|
|
|
if (strcmp(nextIdToDie,queueElemId)==0){
|
|
return 0;
|
|
} else {
|
|
return msgQueueElemDelete(nextIdToDie);
|
|
}
|
|
|
|
|
|
ERROR:
|
|
return -1;
|
|
}
|
|
|
|
|