36 lines
807 B
C
36 lines
807 B
C
|
#include "libnazgul.h"
|
|||
|
#include "nzg_ids.h"
|
|||
|
|
|||
|
/* prototypes des fonctions annexes <20> ne pas exporter */
|
|||
|
int msgSpaceIdIntern(msgSpaceId dest,const msgSpaceId src );
|
|||
|
int msgPoolDataIdIntern(msgSpaceId dest,const msgSpaceId src );
|
|||
|
|
|||
|
int msgSpaceDelete(msgSpaceId spaceId){
|
|||
|
fprintf(stderr,"Deleting msgSpace with id : %s\n",spaceId);
|
|||
|
//int shmId;
|
|||
|
msgSpaceId nzgId;
|
|||
|
msgSpace * space;
|
|||
|
if (msgSpaceIdIntern(nzgId,spaceId) == -1){
|
|||
|
//TODO: message d'erreur
|
|||
|
return -1;
|
|||
|
}
|
|||
|
|
|||
|
space = msgSpaceOpen(spaceId);
|
|||
|
/* TODO: supprimer chaque pool */
|
|||
|
|
|||
|
printf("openned successfully !\n");
|
|||
|
printf("Unlinking DataTab... ");
|
|||
|
if (shm_unlink(space->poolDataTabId) < 0){
|
|||
|
perror("shm_unlink");
|
|||
|
return -1;
|
|||
|
}
|
|||
|
printf("ok\n");
|
|||
|
|
|||
|
if (shm_unlink(nzgId)<0){
|
|||
|
perror("shm_unlink");
|
|||
|
return -1;
|
|||
|
};
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|