httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
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 GMT
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));



Mime
View raw message