From: Andre Date: Sat, 8 Jul 2006 02:17:09 +0000 (+0200) Subject: Simpify client_post_select() X-Git-Tag: v0.2.14~59^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=55d88deacdb93185b326b2fe968e6f11d26af46d Simpify client_post_select() send_bin_buffer() can only return zero if passed a zero length arg which is impossible at this point. --- diff --git a/client_common.c b/client_common.c index b77c192f..c738079b 100644 --- a/client_common.c +++ b/client_common.c @@ -278,11 +278,8 @@ void client_post_select(struct sched *s, struct task *t) case CL_SENDING: /* FIXME: might block */ PARA_INFO_LOG("loaded: %zd\n", *pcd->in_loaded); t->ret = send_bin_buffer(pcd->fd, pcd->inbuf, *pcd->in_loaded); - if (t->ret <= 0) { - if (!t->ret) - t->ret = 1; + if (t->ret < 0) return; - } *pcd->in_loaded = 0; /* FIXME: short writes */ return; case CL_RECEIVING: