From f52757fd68d626da2a20db61b690a22913251206 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 12 Dec 2013 02:36:22 +0000 Subject: [PATCH] Mudando gerenciamento da comunicacao em windows --- iocallback.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/iocallback.c b/iocallback.c index dba7235..5976636 100644 --- a/iocallback.c +++ b/iocallback.c @@ -182,7 +182,27 @@ static gboolean IO_check(GSource *source) */ #ifdef _WIN32 - #error AQUI + fd_set rfds, wfds, xfds; + struct timeval tm; + + memset(&tm,0,sizeof(tm)); + + FD_ZERO(&rfds); + FD_ZERO(&wfds); + FD_ZERO(&xfds); + + if(((IO_Source *) source)->poll.events & G_IO_IN) + { + FD_SET(((IO_Source *) source)->poll.fd, &rfds); + } + + if(((IO_Source *) source)->poll.events & G_IO_OUT) + { + FD_SET(((IO_Source *) source)->poll.fd, &wfds); + } + + if(select(((IO_Source *) source)->poll.fd+1, &rfds, &wfds, &xfds, &tm) > 0) + return TRUE; #else -- libgit2 0.21.2