Use better naming for msgQueue
This commit is contained in:
parent
e863158bda
commit
c0a30e0977
5 changed files with 22 additions and 4 deletions
|
@ -69,6 +69,7 @@ typedef struct MsgSpaceList {
|
|||
} msgSpaceList;
|
||||
|
||||
typedef struct MsgQueueElem {
|
||||
msgQueueElemId id;
|
||||
int poolIndex;
|
||||
int bufferIndex;
|
||||
msgQueueElemId next;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include "libnazgul.h"
|
||||
#include "ids.h"
|
||||
#include "libnazgul.h"
|
||||
|
||||
int queueClose(msgQueue * queue){
|
||||
int msgQueueClose(msgQueue * queue){
|
||||
msgQueueId qId;
|
||||
strcpy(qId,queue->id);
|
||||
|
||||
|
|
|
@ -5,7 +5,14 @@ int msgQueueElemDelete(msgQueueElemId queueElemId){
|
|||
msgQueueElemId nextIdToDie;
|
||||
|
||||
queueElemAddr = msgQueueElemOpen(queueElemId);
|
||||
msgQueueElemClose(queueElem);
|
||||
strcpy(nextIdToDie,queueElemAddr->id);
|
||||
msgQueueElemClose(queueElemAddr);
|
||||
|
||||
if (shm_unlink(queueElemId) < 0){
|
||||
NZG_ERROR("shm_unlink msgQueueElem",queueElemId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
if (nextIdToDie != NULL){
|
||||
return msgQueueElemDelete(nextIdToDie);
|
||||
} else {
|
||||
|
|
|
@ -5,7 +5,16 @@ int msgQueueElemDelete(msgQueueElemId queueElemId){
|
|||
msgQueueElemId nextIdToDie;
|
||||
|
||||
queueElemAddr = msgQueueElemOpen(queueElemId);
|
||||
msgQueueElemClose(queueElem);
|
||||
if (queueElemAddr==NULL){
|
||||
NZG_ERROR("msgQueueElemOpen",queueElemId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
if (msgQueueElemClose(queueElemAddr) < 0){
|
||||
NZG_ERROR("msgQueueElemClose",queueElemId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
if (nextIdToDie != NULL){
|
||||
return msgQueueElemDelete(nextIdToDie);
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "libnazgul.h"
|
||||
#include "ids.h"
|
||||
|
||||
void * queueOpen(msgQueueId queueId){
|
||||
void * msgQueueOpen(msgQueueId queueId){
|
||||
int queueFd;
|
||||
void * queueAddr;
|
||||
|
||||
|
|
Loading…
Reference in a new issue