diff options
author | Nick Kew <niq@apache.org> | 2008-06-01 00:50:23 +0000 |
---|---|---|
committer | Nick Kew <niq@apache.org> | 2008-06-01 00:50:23 +0000 |
commit | b13ebcb1cfab048ec796864d2c52d7bdc9061bd5 (patch) | |
tree | 79ae07f4eee88d85d5502e3b39afd3733c6a1f74 /shmem | |
parent | accfb17f937417673c04b4824512221fd020661e (diff) | |
download | apr-b13ebcb1cfab048ec796864d2c52d7bdc9061bd5.tar.gz |
apr_shm: fix failure in test_named_remove
Supplementary to r661146:
- Include the necessary unistd.h
- Ignore EINVAL from shmctl in shm_cleanup_owner
This fixes the testcase, but doesn't feel like the end of the story:
both this and r661146 feel like sticking plaster over something deeper.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@662114 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
-rw-r--r-- | shmem/unix/shm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 134807de5..68d5fd517 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include <unistd.h> #include "apr_arch_shm.h" #include "apr_general.h" @@ -69,7 +70,7 @@ static apr_status_t shm_cleanup_owner(void *m_) /* Indicate that the segment is to be destroyed as soon * as all processes have detached. This also disallows any * new attachments to the segment. */ - if (shmctl(m->shmid, IPC_RMID, NULL) == -1) { + if (shmctl(m->shmid, IPC_RMID, NULL) == -1 && errno != EINVAL) { return errno; } if (shmdt(m->base) == -1) { |