*** empty log message ***

This commit is contained in:
glenux 2004-03-07 12:53:25 +00:00
parent 3d75566a88
commit 309678b6f4
10 changed files with 26 additions and 22 deletions

View file

@ -3,6 +3,7 @@
#define DEBUG 0 #define DEBUG 0
int msgQueueProtLock(msgSpaceId externId,int queueIdx){ int msgQueueProtLock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd; sem_t * queueSemFd;
msgQueueSemId queueSemId; msgQueueSemId queueSemId;
@ -18,13 +19,11 @@ int msgQueueProtLock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_wait",queueSemId); NZG_ERROR("sem_wait",queueSemId);
goto ERROR; goto ERROR;
} }
int semval=0; semval=0;
sem_getvalue(queueSemFd,&semval); sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); } if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
sem_close(queueSemFd); sem_close(queueSemFd);
sem_close(queueSemFd); sem_close(queueSemFd);
return 0; return 0;

View file

@ -4,6 +4,7 @@
#define DEBUG 0 #define DEBUG 0
int msgQueueProtUnlock(msgSpaceId externId,int queueIdx){ int msgQueueProtUnlock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd; sem_t * queueSemFd;
msgQueueSemId queueSemId; msgQueueSemId queueSemId;
@ -20,7 +21,7 @@ int msgQueueProtUnlock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_post",queueSemId); NZG_ERROR("sem_post",queueSemId);
goto ERROR; goto ERROR;
} }
int semval=0; semval=0;
sem_getvalue(queueSemFd,&semval); sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); } if (DEBUG) { printf("(AfterValue:%d)\n",semval); }

View file

@ -4,6 +4,7 @@
#define DEBUG 0 #define DEBUG 0
int msgQueueReadLock(msgSpaceId externId,int queueIdx){ int msgQueueReadLock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd; sem_t * queueSemFd;
msgQueueSemId queueSemId; msgQueueSemId queueSemId;
@ -19,7 +20,7 @@ int msgQueueReadLock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_wait",queueSemId); NZG_ERROR("sem_wait",queueSemId);
goto ERROR; goto ERROR;
} }
int semval=0; semval=0;
sem_getvalue(queueSemFd,&semval); sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); } if (DEBUG) { printf("(AfterValue:%d)\n",semval); }

View file

@ -4,6 +4,7 @@
#define DEBUG 0 #define DEBUG 0
int msgQueueReadTryLock(msgSpaceId externId,int queueIdx){ int msgQueueReadTryLock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd; sem_t * queueSemFd;
msgQueueSemId queueSemId; msgQueueSemId queueSemId;
@ -19,9 +20,9 @@ int msgQueueReadTryLock(msgSpaceId externId,int queueIdx){
goto ERROR; goto ERROR;
} }
if (DEBUG) { printf("Locking %s\n",queueSemId); } if (DEBUG) { printf("Locking %s\n",queueSemId); }
int semval=0; semval=0;
sem_getvalue(queueSemFd,&semval); sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); } if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
sem_close(queueSemFd); sem_close(queueSemFd);

View file

@ -4,12 +4,13 @@
#define DEBUG 0 #define DEBUG 0
int msgQueueReadUnlock(msgSpaceId externId,int queueIdx){ int msgQueueReadUnlock(msgSpaceId externId,int queueIdx){
sem_t * queueSemFd; int semval;
sem_t * queueSemFd;
msgQueueSemId queueSemId; msgQueueSemId queueSemId;
msgQueueReadSemIdIntern(queueSemId,externId,queueIdx); msgQueueReadSemIdIntern(queueSemId,externId,queueIdx);
if (DEBUG) { printf("Unlocking %s\n",queueSemId); } if (DEBUG) { printf("Unlocking %s\n",queueSemId); }
queueSemFd=sem_open(queueSemId,O_CREAT,SEM_DEFAULT_MODE,1); queueSemFd=sem_open(queueSemId,O_CREAT,SEM_DEFAULT_MODE,1);
if(queueSemFd==SEM_FAILED){ if(queueSemFd==SEM_FAILED){
NZG_ERROR("sem_open",queueSemId); NZG_ERROR("sem_open",queueSemId);
goto ERROR; goto ERROR;
@ -19,9 +20,9 @@ int msgQueueReadUnlock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_post",queueSemId); NZG_ERROR("sem_post",queueSemId);
goto ERROR; goto ERROR;
} }
int semval=0; semval=0;
sem_getvalue(queueSemFd,&semval); sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); } if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
sem_close(queueSemFd); sem_close(queueSemFd);

View file

@ -22,8 +22,10 @@ msgSpace * msgSpaceCreate(
/* msgSpaceList mSList; */ /* msgSpaceList mSList; */
int mSFd; // shm file descriptor int mSFd; // shm file descriptor
int i; int i;
int err;
static int mSIdNum=-1; static int mSIdNum=-1;
msgSpace * space; msgSpace * space;
msgSpaceListElemId listElemId;
msgPoolDataTabId poolDataTabId; msgPoolDataTabId poolDataTabId;
msgPoolData * poolDataTabAddr; msgPoolData * poolDataTabAddr;
@ -50,7 +52,6 @@ msgSpace * msgSpaceCreate(
NZG_ERROR("msgSpaceListLock",""); NZG_ERROR("msgSpaceListLock","");
goto ERROR; goto ERROR;
} }
int err;
if ((err=msgSpaceListFindId(externId)) < 1){ if ((err=msgSpaceListFindId(externId)) < 1){
if (err==0){ if (err==0){
// soit le msgSpace existe deja // soit le msgSpace existe deja
@ -173,7 +174,6 @@ msgSpace * msgSpaceCreate(
} }
msgPoolDataTabClose(space,poolDataTabAddr); msgPoolDataTabClose(space,poolDataTabAddr);
/* on ajoute spaceId a la liste des msgSpace connus */ /* on ajoute spaceId a la liste des msgSpace connus */
msgSpaceListElemId listElemId;
printf("spaceListInit...\n"); printf("spaceListInit...\n");
printf("ok\n"); printf("ok\n");

View file

@ -8,11 +8,11 @@ int msgPoolDataTabSemIdIntern(
msgPoolSemId destSemId,const msgSpaceId externId); msgPoolSemId destSemId,const msgSpaceId externId);
int msgSpaceDelete(msgSpaceId externId){ int msgSpaceDelete(msgSpaceId externId){
fprintf(stderr,"Deleting msgSpace with id : %s\n",externId);
//int shmId; //int shmId;
msgSpaceId nzgId; msgSpaceId nzgId;
msgSpace * space; msgSpace * space;
int i; int i;
fprintf(stderr,"Deleting msgSpace with id : %s\n",externId);
if (msgSpaceIdIntern(nzgId,externId) == -1){ if (msgSpaceIdIntern(nzgId,externId) == -1){
NZG_ERROR("msgSpaceIdIntern",externId); NZG_ERROR("msgSpaceIdIntern",externId);
goto ERROR; goto ERROR;

View file

@ -7,8 +7,9 @@ int msgSpaceListElemCreate(
msgSpace * space) msgSpace * space)
{ {
msgSpaceListElemIdIntern(listElemId,space->externId);
int listElemFd; int listElemFd;
msgSpaceListElem * listElem;
msgSpaceListElemIdIntern(listElemId,space->externId);
listElemFd=shm_open(listElemId, listElemFd=shm_open(listElemId,
O_RDWR|O_CREAT|O_EXCL|O_TRUNC, O_RDWR|O_CREAT|O_EXCL|O_TRUNC,
@ -25,7 +26,6 @@ int msgSpaceListElemCreate(
} }
close(listElemFd); close(listElemFd);
msgSpaceListElem * listElem;
listElem=msgSpaceListElemOpen(listElemId); listElem=msgSpaceListElemOpen(listElemId);
if (listElem ==NULL){ if (listElem ==NULL){
NZG_ERROR("msgSpaceListElemOpen",listElemId); NZG_ERROR("msgSpaceListElemOpen",listElemId);

View file

@ -5,11 +5,11 @@
int msgSpaceListFindId(msgSpaceId externId){ int msgSpaceListFindId(msgSpaceId externId){
msgSpaceList * list; msgSpaceList * list;
msgSpaceId spaceId; msgSpaceId spaceId;
msgSpaceIdIntern(spaceId,externId);
msgSpaceListElemId listHeadElemId; msgSpaceListElemId listHeadElemId;
msgSpaceListElemId listTailElemId; msgSpaceListElemId listTailElemId;
msgSpaceListId listId; msgSpaceListId listId;
msgSpaceIdIntern(spaceId,externId);
list=msgSpaceListOpen(); list=msgSpaceListOpen();
if (list==NULL){ if (list==NULL){
NZG_ERROR("msgSpaceListOpen",""); NZG_ERROR("msgSpaceListOpen","");

View file

@ -4,9 +4,11 @@
int msgSpaceListInit(){ int msgSpaceListInit(){
int spaceListFd; int spaceListFd;
sem_t * spaceListSemFd; sem_t * spaceListSemFd;
msgSpaceList *list;
msgSpaceListSemId spaceListSemId; msgSpaceListSemId spaceListSemId;
msgSpaceListId spaceListId; msgSpaceListId spaceListId;
strcpy(spaceListSemId,DEFAULT_MSGSPACELISTSEMID); strcpy(spaceListSemId,DEFAULT_MSGSPACELISTSEMID);
strcpy(spaceListId,DEFAULT_MSGSPACELISTID); strcpy(spaceListId,DEFAULT_MSGSPACELISTID);
@ -42,7 +44,6 @@ int msgSpaceListInit(){
} }
close(spaceListFd); close(spaceListFd);
msgSpaceList *list;
list=msgSpaceListOpen(); list=msgSpaceListOpen();
if (list == NULL){ if (list == NULL){
NZG_ERROR("msgSpaceListOpen",""); NZG_ERROR("msgSpaceListOpen","");
@ -65,7 +66,7 @@ int msgSpaceListInit(){
ERROR: ERROR:
return -1; return -1;
EXISTING: EXISTING:
if (msgSpaceListUnlock() < 0){ if (msgSpaceListUnlock() < 0){
NZG_ERROR("msgSpaceListUnlock",""); NZG_ERROR("msgSpaceListUnlock","");
goto ERROR; goto ERROR;
} }