apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr/test testsock.c
Date Wed, 02 Jun 2004 08:27:43 GMT
jorton      2004/06/02 01:27:43

  Modified:    test     testsock.c
  Log:
  * test/testsock.c (setup_socket): Return NULL if bind fails, fixing
  test suite hang if port 8021 is in use; all callers updated. (come
  back longjmp, all is forgiven).
  
  Revision  Changes    Path
  1.35      +8 -2      apr/test/testsock.c
  
  Index: testsock.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testsock.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -d -w -u -r1.34 -r1.35
  --- testsock.c	14 May 2004 14:43:22 -0000	1.34
  +++ testsock.c	2 Jun 2004 08:27:43 -0000	1.35
  @@ -85,6 +85,7 @@
       
       rv = apr_socket_bind(sock, sa);
       apr_assert_success(tc, "Problem binding to port", rv);
  +    if (rv) return NULL;
       
       rv = apr_socket_listen(sock, 5);
       apr_assert_success(tc, "Problem listening on socket", rv);
  @@ -97,6 +98,8 @@
       apr_status_t rv;
       apr_socket_t *sock = setup_socket(tc);
       
  +    if (!sock) return;
  +    
       rv = apr_socket_close(sock) ;
       apr_assert_success(tc, "Problem closing socket", rv);
   }
  @@ -111,6 +114,7 @@
       apr_size_t length;
   
       sock = setup_socket(tc);
  +    if (!sock) return;
   
       launch_child(tc, &proc, "read", p);
       
  @@ -143,6 +147,7 @@
       char datastr[STRLEN];
       
       sock = setup_socket(tc);
  +    if (!sock) return;
   
       launch_child(tc, &proc, "write", p);
       
  @@ -175,6 +180,7 @@
       int exit;
       
       sock = setup_socket(tc);
  +    if (!sock) return;
   
       launch_child(tc, &proc, "read", p);
       
  
  
  

Mime
View raw message