X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_out.c;h=1a3aca515358f0bfb4aeb5e788ff4995eb8d1ad3;hb=cca607409068ad0948e7283fb8d0465cabc51686;hp=429fa99d37d3221987bf1a5465e982f5476aa999;hpb=9ae84ad187e2ba440c40f44b8eb21c82c2fdbf12;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_out.c b/src/xcb_out.c index 429fa99..1a3aca5 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -263,6 +263,24 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect return request; } +void +xcb_send_fd(xcb_connection_t *c, int fd) +{ +#if HAVE_SENDMSG + if (c->has_error) + return; + pthread_mutex_lock(&c->iolock); + while (c->out.out_fd.nfd == XCB_MAX_PASS_FD) { + _xcb_out_flush_to(c, c->out.request); + if (c->has_error) + break; + } + if (!c->has_error) + c->out.out_fd.fd[c->out.out_fd.nfd++] = fd; + pthread_mutex_unlock(&c->iolock); +#endif +} + int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent) { int ret;