You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ji...@apache.org on 2014/01/24 23:08:25 UTC
svn commit: r1561210 - in /apr/apr/branches/1.5.x: CHANGES shmem/unix/shm.c
Author: jim
Date: Fri Jan 24 22:08:25 2014
New Revision: 1561210
URL: http://svn.apache.org/r1561210
Log:
not now... revert this fix
Modified:
apr/apr/branches/1.5.x/CHANGES
apr/apr/branches/1.5.x/shmem/unix/shm.c
Modified: apr/apr/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/CHANGES?rev=1561210&r1=1561209&r2=1561210&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.5.x/CHANGES [utf-8] Fri Jan 24 22:08:25 2014
@@ -20,10 +20,6 @@ Changes for APR 1.5.1
*) apr_skiplist: Add compatibility with C++ applications.
[Jeff Trawick]
- *) 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]
-
*) Correct a regression in 1.5.0 which affected out-of-tree
builds on Unix. [Rainer Jung]
Modified: apr/apr/branches/1.5.x/shmem/unix/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/shmem/unix/shm.c?rev=1561210&r1=1561209&r2=1561210&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/shmem/unix/shm.c (original)
+++ apr/apr/branches/1.5.x/shmem/unix/shm.c Fri Jan 24 22:08:25 2014
@@ -104,7 +104,6 @@ APR_DECLARE(apr_status_t) apr_shm_create
#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
/* 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
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
/* 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_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
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;
}