Make the return value of _xcb_conn_wait boolean, instead of syscall-like.
authorJamey Sharp <jamey@minilop.net>
Thu, 23 Feb 2006 18:17:40 +0000 (10:17 -0800)
committerJamey Sharp <jamey@minilop.net>
Thu, 23 Feb 2006 18:17:40 +0000 (10:17 -0800)
src/xcb_conn.c
src/xcb_in.c
src/xcb_out.c

index 50512ee..15b5da6 100644 (file)
@@ -223,5 +223,5 @@ done:
         --c->out.writing;
     --c->in.reading;
 
-    return ret;
+    return ret > 0;
 }
index bb973a3..ce102e5 100644 (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);
index 0afabc2..04b8365 100644 (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;