You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2014/01/24 22:40:35 UTC

svn commit: r1561200 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c

Author: jim
Date: Fri Jan 24 21:40:35 2014
New Revision: 1561200

URL: http://svn.apache.org/r1561200
Log:
Avoid APR check.

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=1561200&r1=1561199&r2=1561200&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Fri Jan 24 21:40:35 2014
@@ -97,18 +97,21 @@ 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;
     }
     if ((shmid = shmget(shmkey, 0, SHM_R | SHM_W)) == -1) {
-        return errno;
+        /* see if we are using a key of 1 */
+        shmkey = ftok(fname, 1);
+        if (shmkey == (key_t)-1) {
+            return errno;
+        }
+        if ((shmid = shmget(shmkey, 0, SHM_R | SHM_W)) == -1)
+            return errno;
+        }
     }
 #if MODULE_MAGIC_NUMBER_MAJOR <= 20081212
 #define ap_unixd_config unixd_config