]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-01-start-finish.c
io: allow freeing of io_conn at any time.
[ccan] / ccan / io / test / run-01-start-finish.c
index eb12e9488aea2eaca1dc445fb1cff6c46bddbbfc..5356244e87e188b19c5ad5cc76c8d4a1a66126a6 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64001"
-#else
 #define PORT "65001"
-#endif
 static int expected_fd;
 
 static void finish_ok(struct io_conn *conn, int *state)
@@ -23,9 +19,6 @@ static void finish_ok(struct io_conn *conn, int *state)
 
 static struct io_plan *init_conn(struct io_conn *conn, int *state)
 {
-#ifdef DEBUG_CONN
-       io_set_debug(conn, true);
-#endif
        ok1(*state == 0);
        (*state)++;
        expected_fd = io_conn_fd(conn);
@@ -69,7 +62,7 @@ static int make_listen_fd(const char *port, struct addrinfo **info)
 int main(void)
 {
        int state = 0;
-       struct addrinfo *addrinfo;
+       struct addrinfo *addrinfo = NULL;
        struct io_listener *l;
        int fd;