else
n = _xcb_write(c->fd, &c->out.queue, &c->out.queue_len);
- if(n < 0 && errno == EAGAIN)
- n = 1;
+ /* XXX: should "nothing was written" be considered failure or
+ * success for this function? it's not an I/O error, but... */
+ n = (n > 0) || (n < 0 && errno == EAGAIN);
if(c->out.vec_len)
{
c->out.vec[c->out.vec_len].iov_base = (void *) pad;
c->out.vec[c->out.vec_len++].iov_len = XCB_PAD(vector[i].iov_len);
}
- if(_xcb_out_flush(c) <= 0)
+ if(!_xcb_out_flush(c))
len = -1;
free(c->out.vec);
c->out.vec = 0;