svn commit: r1926401 - /apr/apr/trunk/test/testshm.c

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <[email protected]>
Author: ivan
Date: Fri Jun 13 21:18:14 2025
New Revision: 1926401

URL: http://svn.apache.org/viewvc?rev=1926401&view=rev
Log:
Revert r1926399 and 1926400.

Modified:
    apr/apr/trunk/test/testshm.c

Modified: apr/apr/trunk/test/testshm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testshm.c?rev=1926401&r1=1926400&r2=1926401&view=diff
==============================================================================
--- apr/apr/trunk/test/testshm.c (original)
+++ apr/apr/trunk/test/testshm.c Fri Jun 13 21:18:14 2025
@@ -208,7 +208,6 @@ static void test_named(abts_case *tc, vo
 static void test_named_remove(abts_case *tc, void *data)
 {
     apr_status_t rv;
-    apr_status_t rv2;
     apr_shm_t *shm, *shm2;
 
     apr_shm_remove(SHARED_FILENAME, p);
@@ -222,11 +221,6 @@ static void test_named_remove(abts_case
 
     rv = apr_shm_remove(SHARED_FILENAME, p);
 
-    /* On some platforms (e.g. Windows), objects are alive until last handle
-     * is closed. So detach from shared memory. */
-    rv2 = apr_shm_detach(shm);
-    APR_ASSERT_SUCCESS(tc, "Error detach shared memory block", rv2);
-
     /* On platforms which acknowledge the removal of the shared resource,
      * ensure another of the same name may be created after removal;
      */
@@ -243,6 +237,9 @@ static void test_named_remove(abts_case
       APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
     }
 
+    rv = apr_shm_destroy(shm);
+    APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
+
     /* Now ensure no named resource remains which we may attach to */
     rv = apr_shm_attach(&shm, SHARED_FILENAME, p);
     ABTS_TRUE(tc, rv != 0);
@@ -251,7 +248,6 @@ static void test_named_remove(abts_case
 static void test_named_delete(abts_case *tc, void *data)
 {
     apr_status_t rv;
-    apr_status_t rv2;
     apr_shm_t *shm, *shm2;
 
     apr_shm_remove(SHARED_FILENAME, p);
@@ -265,11 +261,6 @@ static void test_named_delete(abts_case
 
     rv = apr_shm_delete(shm);
 
-    /* On some platforms (e.g. Windows), objects are alive until last handle
-     * is closed. So detach from shared memory. */
-    rv2 = apr_shm_detach(shm);
-    APR_ASSERT_SUCCESS(tc, "Error detach shared memory block", rv2);
-
     /* On platforms which acknowledge the removal of the shared resource,
      * ensure another of the same name may be created after removal;
      */
@@ -286,6 +277,9 @@ static void test_named_delete(abts_case
       APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
     }
 
+    rv = apr_shm_destroy(shm);
+    APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
+
     /* Now ensure no named resource remains which we may attach to */
     rv = apr_shm_attach(&shm, SHARED_FILENAME, p);
     ABTS_TRUE(tc, rv != 0);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.