]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Simpify client_post_select()
authorAndre <maan@p133.(none)>
Sat, 8 Jul 2006 02:17:09 +0000 (04:17 +0200)
committerAndre <maan@p133.(none)>
Sat, 8 Jul 2006 02:17:09 +0000 (04:17 +0200)
send_bin_buffer() can only return zero if passed a zero length arg
which is impossible at this point.

client_common.c

index b77c192f3a1c31bc0792fd427b39e21518c2fbd1..c738079b6b1f92ab47435bfea9eb6185aa52eef2 100644 (file)
@@ -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: