On 09/11/2015 03:00 PM, [email protected] wrote:
> Author: ylavic
> Date: Fri Sep 11 13:00:53 2015
> New Revision: 1702450
>
> URL: http://svn.apache.org/r1702450
> Log:
> mod_slotmem_shm: Fix balancers and balancer members slots reuse on
> restart when new ones are added (Windows and OS/2 only). PR 58024.
>
> Since Windows and OS/2 don't have the unlink() but the "delete on last close"
> semantic for opened files being removed, we can't reuse the same SHM files
> names for processes of different generation. Let's append the generation
> number in the files names for those.
>
> This commit also axes unused Unix specifics about mutexes/semaphores.
>
> Modified:
> httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
>
> Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=1702450&r1=1702449&r2=1702450&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
> +++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Fri Sep 11 13:00:53
> 2015
> @@ -25,23 +25,6 @@
>
> #include "httpd.h"
> #include "http_main.h"
> -#ifdef AP_NEED_SET_MUTEX_PERMS
> -#include "unixd.h"
> -#endif
> -
> -#if APR_HAVE_UNISTD_H
> -#include <unistd.h> /* for getpid() */
> -#endif
> -
> -#if HAVE_SYS_SEM_H
> -#include <sys/shm.h>
> -#if !defined(SHM_R)
> -#define SHM_R 0400
> -#endif
> -#if !defined(SHM_W)
> -#define SHM_W 0200
> -#endif
> -#endif
>
Why can the above be removed and how is this related to what you try to fix?
> #define AP_SLOTMEM_IS_PREGRAB(t) (t->desc.type & AP_SLOTMEM_TYPE_PREGRAB)
> #define AP_SLOTMEM_IS_PERSIST(t) (t->desc.type & AP_SLOTMEM_TYPE_PERSIST)
> @@ -59,6 +42,7 @@ typedef struct {
>
> struct ap_slotmem_instance_t {
> char *name; /* per segment name */
name now stores the filename. Maybe that should reflected in the comment?
> + char *pname; /* persisted file name */
> int fbased; /* filebased? */
> void *shm; /* ptr to memory segment (apr_shm_t *)
> */
> void *base; /* data set start */
Regards
RĂ¼diger