summaryrefslogtreecommitdiff
path: root/shmem
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2014-01-24 22:07:54 +0000
committerJim Jagielski <jim@apache.org>2014-01-24 22:07:54 +0000
commit81d001a0dbf61b6373b57a8589c0d4841adad3b6 (patch)
tree1c55583ced00a4b36feba208c7ff9f484f94a6a8 /shmem
parentc0277b5f3ef869a3bdc3308acdb46c98fedc3169 (diff)
downloadapr-81d001a0dbf61b6373b57a8589c0d4841adad3b6.tar.gz
Not now... revert
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1561209 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 d93a98bea..060a36945 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,
#endif
#if APR_USE_SHMEM_SHMGET
apr_size_t nbytes;
- 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);
- new_m->shmkey = ftok(filename,
- (int)apr_hashfunc_default(filename, &slen));
+ new_m->shmkey = ftok(filename, 1);
if (new_m->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;
}
@@ -539,7 +533,6 @@ APR_DECLARE(apr_status_t) apr_shm_attach(apr_shm_t **m,
apr_status_t status;
apr_file_t *file; /* file where metadata is stored */
apr_size_t nbytes;
- apr_ssize_t slen;
new_m = apr_palloc(pool, sizeof(apr_shm_t));
@@ -562,9 +555,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);
- new_m->shmkey = ftok(filename,
- (int)apr_hashfunc_default(filename, &slen));
+ new_m->shmkey = ftok(filename, 1);
if (new_m->shmkey == (key_t)-1) {
return errno;
}