l3.libnazgul/src/nzg_spaceDelete.c

36 lines
807 B
C
Raw Normal View History

2004-02-22 11:50:29 +00:00
#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;
}