From 662479760c42fc38c458381ee3eaed92e2c8b733 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Thu, 23 Feb 2006 10:17:40 -0800 Subject: [PATCH] Make the return value of _xcb_conn_wait boolean, instead of syscall-like. --- src/xcb_conn.c | 2 +- src/xcb_in.c | 4 ++-- src/xcb_out.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xcb_conn.c b/src/xcb_conn.c index 50512ee..15b5da6 100644 --- a/src/xcb_conn.c +++ b/src/xcb_conn.c @@ -223,5 +223,5 @@ done: --c->out.writing; --c->in.reading; - return ret; + return ret > 0; } diff --git a/src/xcb_in.c b/src/xcb_in.c index bb973a3..ce102e5 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -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); diff --git a/src/xcb_out.c b/src/xcb_out.c index 0afabc2..04b8365 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -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; -- 2.34.1