diff options
author | Bojan Smojver <bojan@apache.org> | 2008-05-28 23:33:00 +0000 |
---|---|---|
committer | Bojan Smojver <bojan@apache.org> | 2008-05-28 23:33:00 +0000 |
commit | e8e53b5747a97b549f6c4c6c0de71d9dcf800d06 (patch) | |
tree | 55f9255af23f5cf954892c893fc2eed81934eef2 /shmem | |
parent | 1fb6265054617679d772628353d00919fe5b1aa4 (diff) | |
download | apr-e8e53b5747a97b549f6c4c6c0de71d9dcf800d06.tar.gz |
If the named resource was removed by apr_shm_remove(), it may not be there.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@661146 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
-rw-r--r-- | shmem/unix/shm.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c index 95d1c053f..134807de5 100644 --- a/shmem/unix/shm.c +++ b/shmem/unix/shm.c @@ -49,7 +49,12 @@ static apr_status_t shm_cleanup_owner(void *m_) if (munmap(m->base, m->realsize) == -1) { return errno; } - return apr_file_remove(m->filename, m->pool); + if (access(m->filename, F_OK)) { + return APR_SUCCESS; + } + else { + return apr_file_remove(m->filename, m->pool); + } #endif #if APR_USE_SHMEM_MMAP_SHM if (munmap(m->base, m->realsize) == -1) { @@ -70,7 +75,12 @@ static apr_status_t shm_cleanup_owner(void *m_) if (shmdt(m->base) == -1) { return errno; } - return apr_file_remove(m->filename, m->pool); + if (access(m->filename, F_OK)) { + return APR_SUCCESS; + } + else { + return apr_file_remove(m->filename, m->pool); + } #endif } |