Make the return value of _xcb_conn_wait boolean, instead of syscall-like.

This commit is contained in:
Jamey Sharp 2006-02-23 10:17:40 -08:00
parent f8a8b465e0
commit 662479760c
3 changed files with 4 additions and 4 deletions

View File

@ -223,5 +223,5 @@ done:
--c->out.writing;
--c->in.reading;
return ret;
return ret > 0;
}

View File

@ -104,7 +104,7 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **
while(!(e && *e) && ((signed int) (c->in.request_read - request) < 0 ||
(c->in.request_read == request &&
_xcb_queue_is_empty(c->in.current_reply))))
if(_xcb_conn_wait(c, /*should_write*/ 0, &cond) <= 0)
if(!_xcb_conn_wait(c, /*should_write*/ 0, &cond))
goto done;
if(c->in.request_read != request)
@ -145,7 +145,7 @@ XCBGenericEvent *XCBWaitForEvent(XCBConnection *c)
pthread_mutex_lock(&c->iolock);
/* _xcb_list_remove_head returns 0 on empty list. */
while(!(ret = _xcb_queue_dequeue(c->in.events)))
if(_xcb_conn_wait(c, /*should_write*/ 0, &c->in.event_cond) <= 0)
if(!_xcb_conn_wait(c, /*should_write*/ 0, &c->in.event_cond))
break;
wake_up_next_reader(c);

View File

@ -270,7 +270,7 @@ int _xcb_out_flush(XCBConnection *c)
{
int ret = 1;
c->out.request_written = c->out.request;
while(ret > 0 && (c->out.queue_len || c->out.vec_len))
while(ret && (c->out.queue_len || c->out.vec_len))
ret = _xcb_conn_wait(c, /*should_write*/ 1, &c->out.cond);
pthread_cond_broadcast(&c->out.cond);
return ret;