projects
/
free-sw
/
xcb
/
libxcb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor performance improvement: do not call _xcb_in_expect_reply unless it is needed...
[free-sw/xcb/libxcb]
/
src
/
xcb_conn.c
diff --git
a/src/xcb_conn.c
b/src/xcb_conn.c
index
51f8eaa
..
f25cc20
100644
(file)
--- a/
src/xcb_conn.c
+++ b/
src/xcb_conn.c
@@
-32,7
+32,7
@@
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/select.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/select.h>
-#include <
sys/
fcntl.h>
+#include <fcntl.h>
#include <errno.h>
#include "xcb.h"
#include <errno.h>
#include "xcb.h"
@@
-169,7
+169,7
@@
static int write_vec(XCBConnection *c, struct iovec **vector, int *count)
/* Public interface */
/* Public interface */
-XCBConnSetupSuccessRep *XCBGetSetup(XCBConnection *c)
+
const
XCBConnSetupSuccessRep *XCBGetSetup(XCBConnection *c)
{
/* doesn't need locking because it's never written to. */
return c->setup;
{
/* doesn't need locking because it's never written to. */
return c->setup;
@@
-253,7
+253,11
@@
int _xcb_conn_wait(XCBConnection *c, pthread_cond_t *cond, struct iovec **vector
}
pthread_mutex_unlock(&c->iolock);
}
pthread_mutex_unlock(&c->iolock);
- ret = select(c->fd + 1, &rfds, &wfds, 0, 0) > 0;
+ do {
+ ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
+ } while (ret == -1 && errno == EINTR);
+ if (ret < 0)
+ ret = 0;
pthread_mutex_lock(&c->iolock);
if(ret)
pthread_mutex_lock(&c->iolock);
if(ret)