apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1089428 - /apr/apr/trunk/test/testsock.c
Date Wed, 06 Apr 2011 12:38:28 GMT
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);



Mime
View raw message