]> granicus.if.org Git - libevent/commitdiff
Correctly skip ipv6 http test on systems without ipv6
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Mar 2014 22:36:32 +0000 (18:36 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Mar 2014 22:36:32 +0000 (18:36 -0400)
test/regress_http.c

index 0de22565d027d7ee5de05b368a0c116aea15c6cc..5658135f86bdd0270ba419230dbea737044dafba 100644 (file)
@@ -105,8 +105,12 @@ http_bind(struct evhttp *myhttp, ev_uint16_t *pport, int ipv6)
        else
                sock = evhttp_bind_socket_with_handle(myhttp, "127.0.0.1", *pport);
 
-       if (sock == NULL)
-               event_errx(1, "Could not start web server");
+       if (sock == NULL) {
+               if (ipv6)
+                       return -1;
+               else
+                       event_errx(1, "Could not start web server");
+       }
 
        port = regress_get_socket_port(evhttp_bound_socket_get_fd(sock));
        if (port < 0)