apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r662114 - /apr/apr/trunk/shmem/unix/shm.c
Date Sun, 01 Jun 2008 00:50:23 GMT
Author: niq
Date: Sat May 31 17:50:23 2008
New Revision: 662114

URL: http://svn.apache.org/viewvc?rev=662114&view=rev
Log:
apr_shm: fix failure in test_named_remove
Supplementary to r661146:
   - Include the necessary unistd.h
   - Ignore EINVAL from shmctl in shm_cleanup_owner
This fixes the testcase, but doesn't feel like the end of the story:
both this and r661146 feel like sticking plaster over something deeper.

Modified:
    apr/apr/trunk/shmem/unix/shm.c

Modified: apr/apr/trunk/shmem/unix/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/shmem/unix/shm.c?rev=662114&r1=662113&r2=662114&view=diff
==============================================================================
--- apr/apr/trunk/shmem/unix/shm.c (original)
+++ apr/apr/trunk/shmem/unix/shm.c Sat May 31 17:50:23 2008
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <unistd.h>
 #include "apr_arch_shm.h"
 
 #include "apr_general.h"
@@ -69,7 +70,7 @@
         /* Indicate that the segment is to be destroyed as soon
          * as all processes have detached. This also disallows any
          * new attachments to the segment. */
-        if (shmctl(m->shmid, IPC_RMID, NULL) == -1) {
+        if (shmctl(m->shmid, IPC_RMID, NULL) == -1 && errno != EINVAL) {
             return errno;
         }
         if (shmdt(m->base) == -1) {



Mime
View raw message