From: Andre Noll Date: Sun, 31 Mar 2013 12:49:42 +0000 (+0000) Subject: udp_recv: Switch to the alternative post select method. X-Git-Tag: v0.4.13~39^2~40 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=00e793e68a2a79a818f3f468972e5f75d7fdaf8d;p=paraslash.git udp_recv: Switch to the alternative post select method. --- diff --git a/udp_recv.c b/udp_recv.c index 6c5ee026..47078697 100644 --- a/udp_recv.c +++ b/udp_recv.c @@ -49,7 +49,7 @@ static int udp_check_eof(size_t sz, struct iovec iov[2]) return -E_RECV_EOF; } -static void udp_recv_post_select(__a_unused struct sched *s, struct task *t) +static int udp_recv_post_select(__a_unused struct sched *s, struct task *t) { struct receiver_node *rn = container_of(t, struct receiver_node, task); struct btr_node *btrn = rn->btrn; @@ -83,12 +83,12 @@ static void udp_recv_post_select(__a_unused struct sched *s, struct task *t) } ret = readv_ret; out: - if (ret >= 0) - return; - btr_remove_node(&rn->btrn); - t->error = ret; - close(rn->fd); - rn->fd = -1; + if (ret < 0) { + btr_remove_node(&rn->btrn); + close(rn->fd); + rn->fd = -1; + } + return ret; } static void udp_recv_close(struct receiver_node *rn) @@ -223,7 +223,8 @@ void udp_recv_init(struct receiver *r) r->open = udp_recv_open; r->close = udp_recv_close; r->pre_select = udp_recv_pre_select; - r->post_select = udp_recv_post_select; + r->post_select = NULL; + r->new_post_select = udp_recv_post_select; r->parse_config = udp_recv_parse_config; r->free_config = udp_recv_free_config; r->help = (struct ggo_help) {