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 2011/04/06 14:38:28 UTC

svn commit: r1089428 - /apr/apr/trunk/test/testsock.c

Author: trawick
Date: Wed Apr  6 12:38:28 2011
New Revision: 1089428

URL: http://svn.apache.org/viewvc?rev=1089428&view=rev
Log:
add a missing server socket close

remove AF_UNIX socket from filsystem before trying to 
bind, in case it exists from a previous run

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

Modified: apr/apr/trunk/test/testsock.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testsock.c?rev=1089428&r1=1089427&r2=1089428&view=diff
==============================================================================
--- apr/apr/trunk/test/testsock.c (original)
+++ apr/apr/trunk/test/testsock.c Wed Apr  6 12:38:28 2011
@@ -491,6 +491,9 @@ static void test_wait(abts_case *tc, voi
 
     rv = apr_socket_wait(client, APR_WAIT_READ);
     APR_ASSERT_SUCCESS(tc, "Wait for socket failed", rv);
+
+    rv = apr_socket_close(server);
+    APR_ASSERT_SUCCESS(tc, "couldn't close server socket", rv);
 }
 
 abts_suite *testsock(abts_suite *suite)
@@ -510,6 +513,8 @@ abts_suite *testsock(abts_suite *suite)
 #if APR_HAVE_SOCKADDR_UN
     socket_name = UNIX_SOCKET_NAME;
     socket_type = APR_UNIX;
+    /* in case AF_UNIX socket exists from a previous run: */
+    apr_file_remove(socket_name, p);
     abts_run_test(suite, test_create_bind_listen, NULL);
     abts_run_test(suite, test_send, NULL);
     abts_run_test(suite, test_recv, NULL);