]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-07-break.c
ccan/io: add io_out_wait() and io_out_always().
[ccan] / ccan / io / test / run-07-break.c
index 1f69e9f51bb17e3e2aae58075adf5d3a6c8d7d34..d13b0f183609bc8cef34d1992eae0f068358c5be 100644 (file)
@@ -6,7 +6,9 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifndef PORT
+#ifdef DEBUG_CONN
+#define PORT "64007"
+#else
 #define PORT "65007"
 #endif
 
@@ -30,6 +32,9 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 
 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++;
 
@@ -107,11 +112,11 @@ int main(void)
                exit(0);
        }
        freeaddrinfo(addrinfo);
-       ok1(io_loop() == d);
+       ok1(io_loop(NULL, NULL) == d);
        ok1(d->state == 1);
        io_close_listener(l);
 
-       ok1(io_loop() == NULL);
+       ok1(io_loop(NULL, NULL) == NULL);
        ok1(d->state == 3);
        ok1(memcmp(d->buf, "hellothere", sizeof(d->buf)) == 0);
        free(d);