]> git.ozlabs.org Git - ccan/commitdiff
io: remove io_debug support.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 29 Dec 2016 04:29:29 +0000 (14:59 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 29 Dec 2016 23:12:44 +0000 (09:42 +1030)
It seemed like a good idea, but it complicates things and I never used
it (since I never really trusted that the alternate paths would be
equivalent).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
31 files changed:
ccan/io/backend.h
ccan/io/io.c
ccan/io/io.h
ccan/io/test/run-01-start-finish-debug.c [deleted file]
ccan/io/test/run-01-start-finish.c
ccan/io/test/run-02-read-debug.c [deleted file]
ccan/io/test/run-02-read.c
ccan/io/test/run-03-readpartial-debug.c [deleted file]
ccan/io/test/run-03-readpartial.c
ccan/io/test/run-04-writepartial-debug.c [deleted file]
ccan/io/test/run-04-writepartial.c
ccan/io/test/run-05-write-debug.c [deleted file]
ccan/io/test/run-05-write.c
ccan/io/test/run-06-idle.c
ccan/io/test/run-07-break-debug.c [deleted file]
ccan/io/test/run-07-break.c
ccan/io/test/run-09-connect-debug.c [deleted file]
ccan/io/test/run-09-connect.c
ccan/io/test/run-12-bidir-debug.c [deleted file]
ccan/io/test/run-12-bidir.c
ccan/io/test/run-14-duplex-both-read-debug.c [deleted file]
ccan/io/test/run-14-duplex-both-read.c
ccan/io/test/run-15-timeout.c
ccan/io/test/run-16-duplex-test-debug.c [deleted file]
ccan/io/test/run-16-duplex-test.c
ccan/io/test/run-17-homemade-io-debug.c [deleted file]
ccan/io/test/run-17-homemade-io.c
ccan/io/test/run-18-errno-debug.c [deleted file]
ccan/io/test/run-18-errno.c
ccan/io/test/run-19-always-debug.c [deleted file]
ccan/io/test/run-19-always.c

index 3a1f12e7ee859742b0341912de41044c5416b61b..aace0f2bad38d96a6835da31a2a2edf9f020ea6a 100644 (file)
@@ -59,9 +59,6 @@ struct io_plan {
 /* One connection per client. */
 struct io_conn {
        struct fd fd;
 /* One connection per client. */
 struct io_conn {
        struct fd fd;
-       bool debug;
-       /* For duplex to save. */
-       bool debug_saved;
 
        /* always and closing lists. */
        struct list_node always, closing;
 
        /* always and closing lists. */
        struct list_node always, closing;
index cd5557d16af9a5d7bf2e3003febfb89237ff7603..83f933acd994ce58456bd336f9af24f9622e8dd4 100644 (file)
@@ -94,7 +94,6 @@ struct io_conn *io_new_conn_(const tal_t *ctx, int fd,
        conn->finish_arg = NULL;
        list_node_init(&conn->always);
        list_node_init(&conn->closing);
        conn->finish_arg = NULL;
        list_node_init(&conn->always);
        list_node_init(&conn->closing);
-       conn->debug = false;
 
        if (!add_conn(conn))
                return tal_free(conn);
 
        if (!add_conn(conn))
                return tal_free(conn);
@@ -443,34 +442,12 @@ int io_conn_fd(const struct io_conn *conn)
        return conn->fd.fd;
 }
 
        return conn->fd.fd;
 }
 
-void io_duplex_prepare(struct io_conn *conn)
+struct io_plan *io_duplex(struct io_conn *conn,
+                         struct io_plan *in_plan, struct io_plan *out_plan)
 {
 {
-       assert(conn->plan[IO_IN].status == IO_UNSET);
-       assert(conn->plan[IO_OUT].status == IO_UNSET);
-
-       /* We can't sync debug until we've set both: io_wait() and io_always
-        * can't handle it. */
-       conn->debug_saved = conn->debug;
-       io_set_debug(conn, false);
-}
-
-struct io_plan *io_duplex_(struct io_plan *in_plan, struct io_plan *out_plan)
-{
-       struct io_conn *conn;
-
+       assert(conn == container_of(in_plan, struct io_conn, plan[IO_IN]));
        /* in_plan must be conn->plan[IO_IN], out_plan must be [IO_OUT] */
        assert(out_plan == in_plan + 1);
        /* in_plan must be conn->plan[IO_IN], out_plan must be [IO_OUT] */
        assert(out_plan == in_plan + 1);
-
-       /* Restore debug. */
-       conn = container_of(in_plan, struct io_conn, plan[IO_IN]);
-       io_set_debug(conn, conn->debug_saved);
-
-       /* Now set the plans again, to invoke sync debug. */
-       io_set_plan(conn, IO_OUT,
-                   out_plan->io, out_plan->next, out_plan->next_arg);
-       io_set_plan(conn, IO_IN,
-                   in_plan->io, in_plan->next, in_plan->next_arg);
-
        return out_plan + 1;
 }
 
        return out_plan + 1;
 }
 
@@ -504,43 +481,5 @@ struct io_plan *io_set_plan(struct io_conn *conn, enum io_direction dir,
        plan->next_arg = next_arg;
        assert(plan->status == IO_CLOSING || next != NULL);
 
        plan->next_arg = next_arg;
        assert(plan->status == IO_CLOSING || next != NULL);
 
-       if (!conn->debug)
-               return plan;
-
-       if (io_loop_return) {
-               io_debug_complete(conn);
-               return plan;
-       }
-
-       switch (plan->status) {
-       case IO_POLLING:
-               while (do_plan(conn, plan) == 0);
-               break;
-       /* Shouldn't happen, since you said you did plan! */
-       case IO_UNSET:
-               abort();
-       case IO_ALWAYS:
-               /* If other one is ALWAYS, leave in list! */
-               if (conn->plan[!dir].status != IO_ALWAYS)
-                       remove_from_always(conn);
-               next_plan(conn, plan);
-               break;
-       case IO_WAITING:
-       case IO_CLOSING:
-               io_debug_complete(conn);
-       }
-
        return plan;
 }
        return plan;
 }
-
-void io_set_debug(struct io_conn *conn, bool debug)
-{
-       conn->debug = debug;
-
-       /* Debugging means fds must block. */
-       set_blocking(io_conn_fd(conn), debug);
-}
-
-void io_debug_complete(struct io_conn *conn)
-{
-}
index e24beec4666a37284b72f545c735989119381ce5..fe040bce2f0a6c4c6f8070ecdb02b101e46b7360 100644 (file)
@@ -454,11 +454,8 @@ struct io_plan *io_connect_(struct io_conn *conn, const struct addrinfo *addr,
  *                      io_write(conn, b->out, sizeof(b->out), io_close_cb,b));
  * }
  */
  *                      io_write(conn, b->out, sizeof(b->out), io_close_cb,b));
  * }
  */
-#define io_duplex(conn, in_plan, out_plan) \
-       (io_duplex_prepare(conn), io_duplex_(in_plan, out_plan))
-
-struct io_plan *io_duplex_(struct io_plan *in_plan, struct io_plan *out_plan);
-void io_duplex_prepare(struct io_conn *conn);
+struct io_plan *io_duplex(struct io_conn *conn,
+                         struct io_plan *in_plan, struct io_plan *out_plan);
 
 /**
  * io_halfclose - close half of an io_duplex connection.
 
 /**
  * io_halfclose - close half of an io_duplex connection.
@@ -660,37 +657,4 @@ int io_conn_fd(const struct io_conn *conn);
  */
 struct timemono (*io_time_override(struct timemono (*now)(void)))(void);
 
  */
 struct timemono (*io_time_override(struct timemono (*now)(void)))(void);
 
-/**
- * io_set_debug - set synchronous mode on a connection.
- * @conn: the connection.
- * @debug: whether to enable or disable debug.
- *
- * Once @debug is true on a connection, all I/O is done synchronously
- * as soon as it is set, until it is unset or @conn is closed.  This
- * makes it easy to debug what's happening with a connection, but note
- * that other connections are starved while this is being done.
- *
- * See also: io_debug_complete()
- *
- * Example:
- * // Dumb init function to set debug and tell conn to close.
- * static struct io_plan *conn_init(struct io_conn *conn, const char *msg)
- * {
- *     io_set_debug(conn, true);
- *     return io_close(conn);
- * }
- */
-void io_set_debug(struct io_conn *conn, bool debug);
-
-/**
- * io_debug_complete - empty function called when conn is closing/waiting.
- * @conn: the connection.
- *
- * This is for putting a breakpoint onto, when debugging.  It is called
- * when a conn with io_set_debug() true can no longer be synchronous:
- * 1) It is io_close()'d
- * 2) It enters io_wait() (sychronous debug will resume after io_wake())
- * 3) io_break() is called (sychronous debug will resume after io_loop())
- */
-void io_debug_complete(struct io_conn *conn);
 #endif /* CCAN_IO_H */
 #endif /* CCAN_IO_H */
diff --git a/ccan/io/test/run-01-start-finish-debug.c b/ccan/io/test/run-01-start-finish-debug.c
deleted file mode 100644 (file)
index bc43299..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-01-start-finish.c"
index 04952db88e5ce9e3d65c9cadb57fee5e4730e001..5356244e87e188b19c5ad5cc76c8d4a1a66126a6 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64001"
-#else
 #define PORT "65001"
 #define PORT "65001"
-#endif
 static int expected_fd;
 
 static void finish_ok(struct io_conn *conn, int *state)
 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)
 {
 
 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);
        ok1(*state == 0);
        (*state)++;
        expected_fd = io_conn_fd(conn);
diff --git a/ccan/io/test/run-02-read-debug.c b/ccan/io/test/run-02-read-debug.c
deleted file mode 100644 (file)
index eba1363..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-02-read.c"
index 74cb2f021d87393c1dd0110a10a110ad1d52f09a..95000b48ef7ec95799d72b3cf7f072cf9939c6d3 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64002"
-#else
 #define PORT "65002"
 #define PORT "65002"
-#endif
 
 struct data {
        int state;
 
 struct data {
        int state;
@@ -26,9 +22,6 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
diff --git a/ccan/io/test/run-03-readpartial-debug.c b/ccan/io/test/run-03-readpartial-debug.c
deleted file mode 100644 (file)
index 7c9f8c4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-03-readpartial.c"
index 7c24d16e9c53bb1d6f0ffa097ae8bdf52045650f..2e2e8e16ed0892d4b7a952510f8f9004f3fb510b 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64003"
-#else
 #define PORT "65003"
 #define PORT "65003"
-#endif
 
 struct data {
        int state;
 
 struct data {
        int state;
@@ -27,9 +23,6 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
diff --git a/ccan/io/test/run-04-writepartial-debug.c b/ccan/io/test/run-04-writepartial-debug.c
deleted file mode 100644 (file)
index dd40c0c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-04-writepartial.c"
index d3f7043f7b2764ba7bc931defdbaf7709eaa83f7..947f01e576af9e115123eabd777b2cd6280561f8 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64004"
-#else
 #define PORT "65004"
 #define PORT "65004"
-#endif
 
 struct data {
        int state;
 
 struct data {
        int state;
@@ -27,9 +23,6 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
        io_set_finish(conn, finish_ok, d);
        ok1(d->state == 0);
        d->state++;
        io_set_finish(conn, finish_ok, d);
diff --git a/ccan/io/test/run-05-write-debug.c b/ccan/io/test/run-05-write-debug.c
deleted file mode 100644 (file)
index 5c99128..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-05-write.c"
index 41fe2949498b8f2d2166ad7810d54e29bfb351ae..3b0cc72432a30f840e9e0f58f28712dce897f12d 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64005"
-#else
 #define PORT "65005"
 #define PORT "65005"
-#endif
 
 struct data {
        int state;
 
 struct data {
        int state;
@@ -27,9 +23,6 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
        io_set_finish(conn, finish_ok, d);
        ok1(d->state == 0);
        d->state++;
        io_set_finish(conn, finish_ok, d);
index 57d5e20c13ec33223300f409f35953044641abd2..3d7c3cc33201389e0469e29db815335d342c43d6 100644 (file)
@@ -9,11 +9,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64006"
-#else
 #define PORT "65006"
 #define PORT "65006"
-#endif
 
 static struct io_conn *idler;
 
 
 static struct io_conn *idler;
 
diff --git a/ccan/io/test/run-07-break-debug.c b/ccan/io/test/run-07-break-debug.c
deleted file mode 100644 (file)
index 94291c6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-07-break.c"
index d13b0f183609bc8cef34d1992eae0f068358c5be..135dcbb8ffc3374a7b82cc1e3b00d442503662f3 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64007"
-#else
 #define PORT "65007"
 #define PORT "65007"
-#endif
 
 struct data {
        int state;
 
 struct data {
        int state;
@@ -32,9 +28,6 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
diff --git a/ccan/io/test/run-09-connect-debug.c b/ccan/io/test/run-09-connect-debug.c
deleted file mode 100644 (file)
index e7f9dde..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-09-connect.c"
index 124b6a1f70e715f08a3014a8cee72372611ce575..e5f0d1f85c6b6f495e22c656efdeaad7f478d338 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64009"
-#else
 #define PORT "65009"
 #define PORT "65009"
-#endif
 
 static struct io_listener *l;
 static struct data *d2;
 
 static struct io_listener *l;
 static struct data *d2;
@@ -35,9 +31,6 @@ 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)
 {
 
 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);
        ok1(d->state == 0);
        d->state++;
        io_close_listener(l);
diff --git a/ccan/io/test/run-12-bidir-debug.c b/ccan/io/test/run-12-bidir-debug.c
deleted file mode 100644 (file)
index af5fd89..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-12-bidir.c"
index e79acb56db1ce2d68d605b3419e6aa813c4b938c..77843ae7ba0bb2951d32c6d3e56b7d64d2916eed 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64012"
-#else
 #define PORT "65012"
 #define PORT "65012"
-#endif
 
 struct data {
        struct io_listener *l;
 
 struct data {
        struct io_listener *l;
@@ -42,9 +38,6 @@ static struct io_plan *w_done(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
diff --git a/ccan/io/test/run-14-duplex-both-read-debug.c b/ccan/io/test/run-14-duplex-both-read-debug.c
deleted file mode 100644 (file)
index 92bbb67..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-14-duplex-both-read.c"
index 30c46cd5dbd79fd2909a5a36339cd2b7a8089a88..ed77cab8ac69d4530f0525c24f6c1db22407fb17 100644 (file)
@@ -8,11 +8,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64014"
-#else
 #define PORT "65014"
 #define PORT "65014"
-#endif
 
 struct data {
        struct io_listener *l;
 
 struct data {
        struct io_listener *l;
@@ -47,9 +43,6 @@ static struct io_plan *make_duplex(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
index a4ab23add0abed3b0a3bcc5d536983db458ce8b5..64741c4f0c869907d3e212a67018732c8f0c3e40 100644 (file)
@@ -8,11 +8,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
 #include <stdio.h>
 #include <unistd.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64015"
-#else
 #define PORT "65015"
 #define PORT "65015"
-#endif
 
 struct data {
        struct timers timers;
 
 struct data {
        struct timers timers;
@@ -38,9 +34,6 @@ static struct io_plan *no_timeout(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
diff --git a/ccan/io/test/run-16-duplex-test-debug.c b/ccan/io/test/run-16-duplex-test-debug.c
deleted file mode 100644 (file)
index 70ef3db..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-16-duplex-test.c"
index 8631be4519f58a0e0603da35e1d539b34af1dcd8..007f41119614e2016a2d3aef21f7ba9d9465febb 100644 (file)
@@ -8,11 +8,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64016"
-#else
 #define PORT "65016"
 #define PORT "65016"
-#endif
 
 struct data {
        struct io_listener *l;
 
 struct data {
        struct io_listener *l;
@@ -34,9 +30,6 @@ static struct io_plan *io_done(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
 
        ok1(d->state == 0);
        d->state++;
 
diff --git a/ccan/io/test/run-17-homemade-io-debug.c b/ccan/io/test/run-17-homemade-io-debug.c
deleted file mode 100644 (file)
index e26de11..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-17-homemade-io.c"
index d104f3e9a01c18f730da677d847f88172f6628cf..150bcbdc4b4ad88c0a8723092d033325478ab868 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64017"
-#else
 #define PORT "65017"
 #define PORT "65017"
-#endif
 
 struct packet {
        int state;
 
 struct packet {
        int state;
@@ -85,9 +81,6 @@ static struct io_plan *io_read_packet(struct io_conn *conn,
 
 static struct io_plan *init_conn(struct io_conn *conn, struct packet *pkt)
 {
 
 static struct io_plan *init_conn(struct io_conn *conn, struct packet *pkt)
 {
-#ifdef DEBUG_CONN
-       io_set_debug(conn, true);
-#endif
        ok1(pkt->state == 0);
        pkt->state++;
 
        ok1(pkt->state == 0);
        pkt->state++;
 
diff --git a/ccan/io/test/run-18-errno-debug.c b/ccan/io/test/run-18-errno-debug.c
deleted file mode 100644 (file)
index f7ffc3d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-18-errno.c"
index 1bee7682bba94ea26c6b5e885e29bae6e8d50f98..75d84cca1f64a5520698597352769ca3e14f1e92 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64018"
-#else
 #define PORT "65018"
 #define PORT "65018"
-#endif
 
 static void finish_100(struct io_conn *conn, int *state)
 {
 
 static void finish_100(struct io_conn *conn, int *state)
 {
@@ -29,9 +25,6 @@ static void finish_EBADF(struct io_conn *conn, int *state)
 
 static struct io_plan *init_conn(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
        if (*state == 0) {
                (*state)++;
                errno = 100;
        if (*state == 0) {
                (*state)++;
                errno = 100;
diff --git a/ccan/io/test/run-19-always-debug.c b/ccan/io/test/run-19-always-debug.c
deleted file mode 100644 (file)
index f36d58e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define DEBUG_CONN
-#include "run-19-always.c"
index 7a015f28b21690ee55121a2dd3f76bbf25fca8f7..af190a4d025efeaa085ff9fd0c4711352a14f0f8 100644 (file)
@@ -6,11 +6,7 @@
 #include <sys/wait.h>
 #include <stdio.h>
 
 #include <sys/wait.h>
 #include <stdio.h>
 
-#ifdef DEBUG_CONN
-#define PORT "64019"
-#else
 #define PORT "65019"
 #define PORT "65019"
-#endif
 
 struct data {
        int state;
 
 struct data {
        int state;
@@ -32,9 +28,6 @@ static struct io_plan *write_buf(struct io_conn *conn, struct data *d)
 
 static struct io_plan *init_conn(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++;
        io_set_finish(conn, finish_ok, d);
        ok1(d->state == 0);
        d->state++;
        io_set_finish(conn, finish_ok, d);