summaryrefslogtreecommitdiff
path: root/shmem
diff options
context:
space:
mode:
authorjim <jim@13f79535-47bb-0310-9956-ffa450edef68>2014-01-24 22:08:25 +0000
committerjim <jim@13f79535-47bb-0310-9956-ffa450edef68>2014-01-24 22:08:25 +0000
commitde639f742b1ce88b1dc4083ad2b79908d5201cdc (patch)
tree51b9c349befdc64a9730e4413d66f5a1a13f1dce /shmem
parent3660c008406c2954b0330cd53d7c7186b959e36d (diff)
downloadlibapr-de639f742b1ce88b1dc4083ad2b79908d5201cdc.tar.gz
not now... revert this fix
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1561210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
-rw-r--r--shmem/unix/shm.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/shmem/unix/shm.c b/shmem/unix/shm.c
index b1b984357..54a6f1ac6 100644
--- a/shmem/unix/shm.c
+++ b/shmem/unix/shm.c
@@ -104,7 +104,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
#if APR_USE_SHMEM_SHMGET
apr_size_t nbytes;
key_t shmkey;
- apr_ssize_t slen;
#endif
#if APR_USE_SHMEM_MMAP_ZERO || APR_USE_SHMEM_SHMGET || \
APR_USE_SHMEM_MMAP_TMP || APR_USE_SHMEM_MMAP_SHM
@@ -314,9 +313,7 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
/* ftok() (on solaris at least) requires that the file actually
* exist before calling ftok(). */
- slen = strlen(filename);
- shmkey = ftok(filename,
- (int)apr_hashfunc_default(filename, &slen));
+ shmkey = ftok(filename, 1);
if (shmkey == (key_t)-1) {
apr_file_close(file);
return errno;
@@ -386,7 +383,6 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
apr_file_t *file;
key_t shmkey;
int shmid;
- apr_ssize_t slen;
#endif
#if APR_USE_SHMEM_MMAP_TMP
@@ -406,9 +402,7 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename,
/* ftok() (on solaris at least) requires that the file actually
* exist before calling ftok(). */
- slen = strlen(filename);
- shmkey = ftok(filename,
- (int)apr_hashfunc_default(filename, &slen));
+ shmkey = ftok(filename, 1);
if (shmkey == (key_t)-1) {
goto shm_remove_failed;
}
@@ -540,7 +534,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
apr_file_t *file; /* file where metadata is stored */
apr_size_t nbytes;
key_t shmkey;
- apr_ssize_t slen;
new_m = apr_palloc(pool, sizeof(apr_shm_t));
@@ -563,9 +556,7 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
new_m->filename = apr_pstrdup(pool, filename);
new_m->pool = pool;
- slen = strlen(filename);
- shmkey = ftok(filename,
- (int)apr_hashfunc_default(filename, &slen));
+ shmkey = ftok(filename, 1);
if (shmkey == (key_t)-1) {
return errno;
}