diff options
Diffstat (limited to 'shmem/unix/shm.c')
-rw-r--r-- | shmem/unix/shm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 1ae3cfc3d..5041b30bd 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -194,6 +194,11 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m, new_m->shmid = shmid; + /* Remove the segment once use count hits zero. */ + if (shmctl(shmid, IPC_RMID, NULL) == -1) { + return errno; + } + *m = new_m; return APR_SUCCESS; #endif /* APR_USE_SHMEM_SHMGET_ANON */ |