]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-09-connect.c
ccan/io: implement debug.
[ccan] / ccan / io / test / run-09-connect.c
index 8f57f00d8e0f4a6474f63280b20f3b3b6946883d..124b6a1f70e715f08a3014a8cee72372611ce575 100644 (file)
@@ -6,7 +6,9 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifndef PORT
+#ifdef DEBUG_CONN
+#define PORT "64009"
+#else
 #define PORT "65009"
 #endif
 
@@ -33,6 +35,9 @@ static struct io_plan *connected(struct io_conn *conn, struct data *d2)
 
 static struct io_plan *init_conn(struct io_conn *conn, struct data *d)
 {
+#ifdef DEBUG_CONN
+       io_set_debug(conn, true);
+#endif
        ok1(d->state == 0);
        d->state++;
        io_close_listener(l);
@@ -99,7 +104,7 @@ int main(void)
                    addrinfo->ai_protocol);
        ok1(io_new_conn(NULL, fd, setup_connect, addrinfo));
 
-       ok1(io_loop() == NULL);
+       ok1(io_loop(NULL, NULL) == NULL);
        ok1(d->state == 2);
        ok1(d2->state == 2);