2004-02-23 20:37:08 +00:00
|
|
|
#include "libnazgul.h"
|
|
|
|
|
|
|
|
int msgQueueElemDelete(msgQueueElemId queueElemId){
|
|
|
|
msgQueueElem * queueElemAddr;
|
|
|
|
msgQueueElemId nextIdToDie;
|
|
|
|
|
2004-02-23 22:34:28 +00:00
|
|
|
|
2004-02-23 20:37:08 +00:00
|
|
|
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 23:02:21 +00:00
|
|
|
if (strcmp(nextIdToDie,queueElemId)==0){
|
2004-02-23 20:37:08 +00:00
|
|
|
return 0;
|
2004-02-23 23:02:21 +00:00
|
|
|
} else {
|
|
|
|
return msgQueueElemDelete(nextIdToDie);
|
2004-02-23 20:37:08 +00:00
|
|
|
}
|
|
|
|
|
2004-02-23 22:34:28 +00:00
|
|
|
|
2004-02-23 20:37:08 +00:00
|
|
|
ERROR:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|