Add .pc.in files for all the new extension libraries. Generate .pc files from the...
[free-sw/xcb/libxcb] / src / xcb_in.c
index 15bc915..3bf54f3 100644 (file)
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <sys/select.h>
 #include <errno.h>
 
 #include "xcb.h"
@@ -312,9 +313,7 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **
         reader_list **prev_reader;
 
         for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next)
-            if((*prev_reader)->request == request)
-                goto done; /* error */
-
+            /* empty */;
         reader.request = request;
         reader.data = &cond;
         reader.next = *prev_reader;
@@ -324,7 +323,6 @@ void *XCBWaitForReply(XCBConnection *c, unsigned int request, XCBGenericError **
             if(!_xcb_conn_wait(c, &cond, 0, 0))
                 break;
 
-done:
         for(prev_reader = &c->in.readers; *prev_reader && (*prev_reader)->request <= request; prev_reader = &(*prev_reader)->next)
             if(*prev_reader == &reader)
             {
@@ -445,18 +443,16 @@ void _xcb_in_destroy(_xcb_in *in)
 
 int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workarounds workaround, int flags)
 {
-    if(workaround != WORKAROUND_NONE || flags != 0)
-    {
-        pending_reply *pend = malloc(sizeof(pending_reply));
-        if(!pend)
-            return 0;
-        pend->request = request;
-        pend->workaround = workaround;
-        pend->flags = flags;
-        pend->next = 0;
-        *c->in.pending_replies_tail = pend;
-        c->in.pending_replies_tail = &pend->next;
-    }
+    pending_reply *pend = malloc(sizeof(pending_reply));
+    assert(workaround != WORKAROUND_NONE || flags != 0);
+    if(!pend)
+        return 0;
+    pend->request = request;
+    pend->workaround = workaround;
+    pend->flags = flags;
+    pend->next = 0;
+    *c->in.pending_replies_tail = pend;
+    c->in.pending_replies_tail = &pend->next;
     return 1;
 }