Commit 46bfa187 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Split the -M event handler into the two different handlers it is.

parent 14d8ae32
...@@ -578,16 +578,16 @@ Marg_closer(void *priv) ...@@ -578,16 +578,16 @@ Marg_closer(void *priv)
M_fd = -1; M_fd = -1;
} }
static int static int __match_proto__(vev_cb_f)
Marg_poker(const struct vev *e, int what) Marg_connect(const struct vev *e, int what)
{ {
struct vsb *vsb; struct vsb *vsb;
int s, k; int k;
socklen_t l; socklen_t l;
(void)what; /* XXX: ??? */ assert(e == M_conn);
(void)what;
if (e == M_conn) {
/* Our connect(2) returned, check result */ /* Our connect(2) returned, check result */
l = sizeof k; l = sizeof k;
AZ(getsockopt(M_fd, SOL_SOCKET, SO_ERROR, &k, &l)); AZ(getsockopt(M_fd, SOL_SOCKET, SO_ERROR, &k, &l));
...@@ -609,9 +609,15 @@ Marg_poker(const struct vev *e, int what) ...@@ -609,9 +609,15 @@ Marg_poker(const struct vev *e, int what)
VSB_delete(vsb); VSB_delete(vsb);
M_poll = 1; M_poll = 1;
return (1); return (1);
} }
static int __match_proto__(vev_cb_f)
Marg_poker(const struct vev *e, int what)
{
int s;
assert(e == M_poker); assert(e == M_poker);
(void)what;
M_poker->timeout = M_poll; /* XXX nasty ? */ M_poker->timeout = M_poll; /* XXX nasty ? */
if (M_fd >= 0) if (M_fd >= 0)
...@@ -626,7 +632,7 @@ Marg_poker(const struct vev *e, int what) ...@@ -626,7 +632,7 @@ Marg_poker(const struct vev *e, int what)
M_conn = vev_new(); M_conn = vev_new();
AN(M_conn); AN(M_conn);
M_conn->callback = Marg_poker; M_conn->callback = Marg_connect;
M_conn->name = "-M connector"; M_conn->name = "-M connector";
M_conn->fd_flags = EV_WR; M_conn->fd_flags = EV_WR;
M_conn->fd = s; M_conn->fd = s;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment