Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 13844 invoked from network); 5 May 2009 12:39:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 May 2009 12:39:12 -0000 Received: (qmail 87332 invoked by uid 500); 5 May 2009 12:39:11 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 87252 invoked by uid 500); 5 May 2009 12:39:11 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 87243 invoked by uid 99); 5 May 2009 12:39:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 12:39:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 12:39:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1FDFD238893B; Tue, 5 May 2009 12:38:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r771697 - in /httpd/httpd/trunk: include/ap_slotmem.h modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c Date: Tue, 05 May 2009 12:38:31 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090505123848.1FDFD238893B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Tue May 5 12:38:15 2009 New Revision: 771697 URL: http://svn.apache.org/viewvc?rev=771697&view=rev Log: Move to an enum, instead of bitmaps... no functional change Modified: httpd/httpd/trunk/include/ap_slotmem.h httpd/httpd/trunk/modules/mem/mod_plainmem.c httpd/httpd/trunk/modules/mem/mod_sharedmem.c httpd/httpd/trunk/server/slotmem.c Modified: httpd/httpd/trunk/include/ap_slotmem.h URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_slotmem.h?rev=771697&r1=771696&r2=771697&view=diff ============================================================================== --- httpd/httpd/trunk/include/ap_slotmem.h (original) +++ httpd/httpd/trunk/include/ap_slotmem.h Tue May 5 12:38:15 2009 @@ -50,7 +50,9 @@ #define AP_SLOTMEM_STORAGE "slotmem" -#define CREPER_SLOTMEM 2 /* create a persistent slotmem */ +typedef enum { + SLOTMEM_PERSIST /* create a persistent slotmem */ +} apslotmem_type; typedef struct ap_slotmem_t ap_slotmem_t; @@ -87,7 +89,7 @@ * @param pool is pool used * @return APR_SUCCESS if all went well */ - apr_status_t (* slotmem_create)(ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, int type, apr_pool_t *pool); + apr_status_t (* slotmem_create)(ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, apslotmem_type type, apr_pool_t *pool); /** * attach to an existing slotmem. * This would attach to shared memory, basically. @@ -170,7 +172,7 @@ * @param pool is pool used * @return APR_SUCCESS if all went well */ -AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm, ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, int type, apr_pool_t *pool); +AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm, ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, apslotmem_type type, apr_pool_t *pool); /** * attach to an existing slotmem. Modified: httpd/httpd/trunk/modules/mem/mod_plainmem.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/mod_plainmem.c?rev=771697&r1=771696&r2=771697&view=diff ============================================================================== --- httpd/httpd/trunk/modules/mem/mod_plainmem.c (original) +++ httpd/httpd/trunk/modules/mem/mod_plainmem.c Tue May 5 12:38:15 2009 @@ -51,7 +51,7 @@ return APR_SUCCESS; } -static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, int type, apr_pool_t *pool) +static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, apslotmem_type type, apr_pool_t *pool) { ap_slotmem_t *res; ap_slotmem_t *next = globallistmem; Modified: httpd/httpd/trunk/modules/mem/mod_sharedmem.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/mod_sharedmem.c?rev=771697&r1=771696&r2=771697&view=diff ============================================================================== --- httpd/httpd/trunk/modules/mem/mod_sharedmem.c (original) +++ httpd/httpd/trunk/modules/mem/mod_sharedmem.c Tue May 5 12:38:15 2009 @@ -63,6 +63,7 @@ static apr_global_mutex_t *smutex; static const char *mutex_fname; +/* apr:shmem/unix/shm.c */ static apr_status_t unixd_set_shm_perms(const char *fname) { #ifdef AP_NEED_SET_MUTEX_PERMS @@ -207,7 +208,7 @@ return APR_SUCCESS; } -static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, int type, apr_pool_t *pool) +static apr_status_t slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, apslotmem_type type, apr_pool_t *pool) { /* void *slotmem = NULL; */ void *ptr; @@ -283,6 +284,8 @@ /* Set permissions to shared memory * so it can be attached by child process * having different user credentials + * + * See apr:shmem/unix/shm.c */ unixd_set_shm_perms(fname); } @@ -292,7 +295,7 @@ memcpy(ptr, &desc, sizeof(desc)); ptr = ptr + sizeof(desc); memset(ptr, 0, item_size * item_num); - if (type & CREPER_SLOTMEM) + if (type == SLOTMEM_PERSIST) restore_slotmem(ptr, fname, item_size, item_num, pool); } Modified: httpd/httpd/trunk/server/slotmem.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/slotmem.c?rev=771697&r1=771696&r2=771697&view=diff ============================================================================== --- httpd/httpd/trunk/server/slotmem.c (original) +++ httpd/httpd/trunk/server/slotmem.c Tue May 5 12:38:15 2009 @@ -42,7 +42,7 @@ AP_DECLARE(apr_status_t) ap_slotmem_create(ap_slotmem_storage_method *sm, ap_slotmem_t **new, const char *name, apr_size_t item_size, unsigned int item_num, - int type, + apslotmem_type type, apr_pool_t *pool) { return (sm->slotmem_create(new, name, item_size, item_num, type, pool));