From: hadaq Date: Thu, 19 Jul 2012 23:46:23 +0000 (+0000) Subject: fixed fuck-bug (fds) X-Git-Tag: v6.0~20 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=eb7d11549aa6510256b7774a20107963b6cf5270;p=trbnettools.git fixed fuck-bug (fds) --- diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index c3e1555..9e2b0c4 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -1,11 +1,11 @@ #ifdef ETRAX -const char trbnet_version[] = "$Revision: 4.37 $ Local Etrax"; +const char trbnet_version[] = "$Revision: 4.38 $ Local Etrax"; #elif defined PEXOR -const char trbnet_version[] = "$Revision: 4.37 $ Local Pexor"; +const char trbnet_version[] = "$Revision: 4.38 $ Local Pexor"; #elif defined TRB3 -const char trbnet_version[] = "$Revision: 4.37 $ Local TRB3"; +const char trbnet_version[] = "$Revision: 4.38 $ Local TRB3"; #else -const char trbnet_version[] = "$Revision: 4.37 $ UNKNOWN, i.e. ERROR"; +const char trbnet_version[] = "$Revision: 4.38 $ UNKNOWN, i.e. ERROR"; #endif #include @@ -399,6 +399,11 @@ static int getUDPPackage() } /* Wait for data ready */ + /* Set Socket Timeout */ + + FD_ZERO(&fds); + FD_SET(trb3_sockfd, &fds); + status = pselect(trb3_sockfd + 1, &fds, NULL, NULL, &tv, NULL); if (status == -1) { trb_errno = TRB_TRB3_SOCKET_ERROR; @@ -1636,9 +1641,6 @@ int init_ports() trb3_addr.sin_addr = *((struct in_addr*)host->h_addr); memset(&(trb3_addr.sin_zero), 0, 8); - /* Set Socket Timeout */ - FD_ZERO(&fds); - FD_SET(trb3_sockfd, &fds); /* Init semaphore and signal handling */ if (init_semaphore() == -1) return -1;