X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_out.c;h=62d7053338742e54f59433cbaa0d2690e917df38;hb=6149c7a6b57a193bc132fbc35b1772b75e5c7ca7;hp=04b8365fd561a6c3be319138fbe9a8ba2ac13474;hpb=662479760c42fc38c458381ee3eaed92e2c8b733;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_out.c b/src/xcb_out.c index 04b8365..62d7053 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -199,8 +199,9 @@ int _xcb_out_write(XCBConnection *c) 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) { @@ -258,7 +259,7 @@ int _xcb_out_write_block(XCBConnection *c, struct iovec *vector, size_t count) 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;