httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1542732 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
Date Sun, 17 Nov 2013 14:22:58 GMT
Author: jim
Date: Sun Nov 17 14:22:58 2013
New Revision: 1542732

URL: http://svn.apache.org/r1542732
Log:
Handle the gugz fix in APR 1.5.1 regarding duplicate
keys.

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=1542732&r1=1542731&r2=1542732&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Sun Nov 17 14:22:58 2013
@@ -28,6 +28,8 @@
 #ifdef AP_NEED_SET_MUTEX_PERMS
 #include "unixd.h"
 #endif
+#include "apr_version.h"
+#include "apr_hash.h"
 
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>         /* for getpid() */
@@ -95,7 +97,13 @@ static apr_status_t unixd_set_shm_perms(
     key_t shmkey;
     int shmid;
 
+#if APR_VERSION_AT_LEAST(1,5,1)
+    apr_ssize_t slen = strlen(fname);
+    shmkey = ftok(fname,
+                  (int)apr_hashfunc_default(fname, &slen));
+#else
     shmkey = ftok(fname, 1);
+#endif
     if (shmkey == (key_t)-1) {
         return errno;
     }



Mime
View raw message