Use better naming for msgQueue

This commit is contained in:
Glenn Y. Rolland 2019-09-17 14:49:28 +02:00
parent e863158bda
commit c0a30e0977
5 changed files with 22 additions and 4 deletions

View file

@ -69,6 +69,7 @@ typedef struct MsgSpaceList {
} msgSpaceList;
typedef struct MsgQueueElem {
msgQueueElemId id;
int poolIndex;
int bufferIndex;
msgQueueElemId next;

View file

@ -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);

View file

@ -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 {

View file

@ -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 {

View file

@ -1,7 +1,7 @@
#include "libnazgul.h"
#include "ids.h"
void * queueOpen(msgQueueId queueId){
void * msgQueueOpen(msgQueueId queueId){
int queueFd;
void * queueAddr;