You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2005/08/01 16:50:23 UTC
svn commit: r226809 - in /httpd/httpd/trunk/modules/ldap: util_ldap.c
util_ldap_cache.c
Author: jorton
Date: Mon Aug 1 07:50:21 2005
New Revision: 226809
URL: http://svn.apache.org/viewcvs?rev=226809&view=rev
Log:
* modules/ldap/util_ldap.c (util_ldap_post_config): Don't attempt to
remove the shm segment here.
* modules/ldap/util_ldap_cache.c (util_ldap_cache_init): Properly
remove the shm segment here before creating a new one; don't attach to
any existing shm segment if apr_shm_create() fails.
(util_ldap_cache_module_kill): Don't attempt to remove the shm segment
here; apr_shm_destroy() does that anyway.
Modified:
httpd/httpd/trunk/modules/ldap/util_ldap.c
httpd/httpd/trunk/modules/ldap/util_ldap_cache.c
Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=226809&r1=226808&r2=226809&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Mon Aug 1 07:50:21 2005
@@ -1817,7 +1817,6 @@
if (st->cache_file) {
char *lck_file = apr_pstrcat(st->pool, st->cache_file, ".lck",
NULL);
- apr_file_remove(st->cache_file, ptemp);
apr_file_remove(lck_file, ptemp);
}
#endif
Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap_cache.c?rev=226809&r1=226808&r2=226809&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap_cache.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap_cache.c Mon Aug 1 07:50:21 2005
@@ -391,9 +391,6 @@
if (st->cache_shm != NULL) {
apr_status_t result = apr_shm_destroy(st->cache_shm);
st->cache_shm = NULL;
- if (st->cache_file) {
- apr_file_remove(st->cache_file, st->pool);
- }
return result;
}
#endif
@@ -406,16 +403,12 @@
apr_status_t result;
apr_size_t size;
+ /* Remove any existing shm segment with this name. */
+ apr_shm_remove(st->cache_file, st->pool);
+
size = APR_ALIGN_DEFAULT(st->cache_bytes);
result = apr_shm_create(&st->cache_shm, size, st->cache_file, st->pool);
- if (result == APR_EEXIST) {
- /*
- * The cache could have already been created (i.e. we may be a child process). See
- * if we can attach to the existing shared memory
- */
- result = apr_shm_attach(&st->cache_shm, st->cache_file, st->pool);
- }
if (result != APR_SUCCESS) {
return result;
}