commit 4ed774d8741801548144502b52af277aafc376a3 Author: Oswald Buddenhagen <o...@kde.org> Date: Fri Mar 29 18:11:57 2013 +0100
improve socket connect() error reporting with poll() turns out that poll() may (and on linux does) signal POLLERR on connection failure. this is unlike select(), which is specified to signal write readiness in every case. consequently, check whether we are connecting before checking for POLLERR. src/socket.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/socket.c b/src/socket.c index de2f15a..3763f62 100644 --- a/src/socket.c +++ b/src/socket.c @@ -633,14 +633,14 @@ socket_fd_cb( int events, void *aux ) { conn_t *conn = (conn_t *)aux; - if (events & POLLERR) { - error( "Unidentified socket error from %s.\n", conn->name ); - socket_fail( conn ); + if (conn->state == SCK_CONNECTING) { + socket_connected( conn ); return; } - if (conn->state == SCK_CONNECTING) { - socket_connected( conn ); + if (events & POLLERR) { + error( "Unidentified socket error from %s.\n", conn->name ); + socket_fail( conn ); return; } ------------------------------------------------------------------------------ Own the Future-Intel(R) Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel