From b3a4623a26c3ec6d73f55a9642a922b834360ba1 Mon Sep 17 00:00:00 2001 From: glenux Date: Thu, 26 Feb 2004 08:11:00 +0000 Subject: [PATCH] *** empty log message *** --- src/spaceDelete.c | 19 +++++++++++++++++-- test/put_get_mono.c | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/spaceDelete.c b/src/spaceDelete.c index 43fd717..8d3319a 100644 --- a/src/spaceDelete.c +++ b/src/spaceDelete.c @@ -39,9 +39,24 @@ int msgSpaceDelete(msgSpaceId externId){ printf("ok\n"); if (shm_unlink(nzgId)<0){ - perror("shm_unlink"); - return -1; + NZG_ERROR("shm_unlink",nzgId); + goto ERROR; }; + if (msgSpaceListLock()<0){ + NZG_ERROR("msgSpaceListLock",""); + goto ERROR; + } + + if (msgSpaceListRem(nzgId) < 0){ + NZG_ERROR("msgSpaceListRem",nzgId); + goto ERROR; + } + if (msgSpaceListUnlock()< 0){ + NZG_ERROR("msgSpaceListUnlock",""); + goto ERROR; + } return 0; +ERROR: + return -1; } diff --git a/test/put_get_mono.c b/test/put_get_mono.c index fb1aa94..92afea8 100644 --- a/test/put_get_mono.c +++ b/test/put_get_mono.c @@ -40,5 +40,6 @@ int main(void) { montext=msgGet(mSPAC,0,0); printf("get-ok\n"); printf("### test Reception %d ###\n",(int)*montext); + msgSpaceDelete(testId); return 0; }