You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2015/04/05 13:50:45 UTC
svn commit: r1671386 - /apr/apr/trunk/test/testprocmutex.c
Author: trawick
Date: Sun Apr 5 11:50:45 2015
New Revision: 1671386
URL: http://svn.apache.org/r1671386
Log:
Fix build on non-Unix.
This test was never implemented if !APR_HAS_FORK, but the
capability check was error prone.
Modified:
apr/apr/trunk/test/testprocmutex.c
Modified: apr/apr/trunk/test/testprocmutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testprocmutex.c?rev=1671386&r1=1671385&r2=1671386&view=diff
==============================================================================
--- apr/apr/trunk/test/testprocmutex.c (original)
+++ apr/apr/trunk/test/testprocmutex.c Sun Apr 5 11:50:45 2015
@@ -196,11 +196,9 @@ static void test_exclusive(abts_case *tc
*x == MAX_COUNTER);
}
}
-#endif
static void proc_mutex(abts_case *tc, void *data)
{
-#if APR_HAS_FORK
apr_status_t rv;
const char *shmname = "tpm.shm";
apr_shm_t *shm;
@@ -220,9 +218,6 @@ static void proc_mutex(abts_case *tc, vo
test_exclusive(tc, NULL, data);
rv = apr_shm_destroy(shm);
APR_ASSERT_SUCCESS(tc, "Error destroying shared memory block", rv);
-#else
- ABTS_NOT_IMPL(tc, "APR lacks fork() support");
-#endif
}
@@ -255,3 +250,18 @@ abts_suite *testprocmutex(abts_suite *su
}
return suite;
}
+
+#else /* APR_HAS_FORK */
+
+static void proc_mutex(abts_case *tc, void *data)
+{
+ ABTS_NOT_IMPL(tc, "APR lacks fork() support");
+}
+
+abts_suite *testprocmutex(abts_suite *suite)
+{
+ suite = ADD_SUITE(suite);
+ abts_run_test(suite, proc_mutex, NULL);
+ return suite;
+}
+#endif /* APR_HAS_FORK */