Handle the gugz fix in APR 1.5.1 regarding duplicate

keys.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542732 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Jagielski
2013-11-17 14:22:58 +00:00
parent 5c02313fb3
commit ec1e7e9ca0

View File

@ -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(const char *fname)
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;
}