diff options
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | shmem/unix/shm.c | 15 |
2 files changed, 3 insertions, 16 deletions
@@ -6,10 +6,6 @@ Changes for APR 2.0.0 *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this. [Tom Donovan] - *) When using shmget-based shared memory, the ID used for ftok is - now an APR hash of the filename instead of the constant '1'. - PR 53996 [Jim Jagielski] - *) Changes to apr_pollset_method_e enum value of APR_POLLSET_POLL and APR_POLLSET_AIO_MSGQ. Restore APR_POLLSET_POLL to its pre-r1308910 (April 2012) value, and move APR_POLLSET_AIO_MSGQ ahead. This restores 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; } |