From: hadaq Date: Wed, 18 Jul 2012 21:49:17 +0000 (+0000) Subject: pselect bug fixed, + 1 was missing X-Git-Tag: v6.0~26 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=7486e7a2676b92cd30ee821a378ae274fc58cbb9;p=trbnettools.git pselect bug fixed, + 1 was missing --- diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index 9e3d106..3a3f2f1 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -1,11 +1,11 @@ #ifdef ETRAX -const char trbnet_version[] = "$Revision: 4.33 $ Local Etrax"; +const char trbnet_version[] = "$Revision: 4.34 $ Local Etrax"; #elif defined PEXOR -const char trbnet_version[] = "$Revision: 4.33 $ Local Pexor"; +const char trbnet_version[] = "$Revision: 4.34 $ Local Pexor"; #elif defined TRB3 -const char trbnet_version[] = "$Revision: 4.33 $ Local TRB3"; +const char trbnet_version[] = "$Revision: 4.34 $ Local TRB3"; #else -const char trbnet_version[] = "$Revision: 4.33 $ UNKNOWN, i.e. ERROR"; +const char trbnet_version[] = "$Revision: 4.34 $ UNKNOWN, i.e. ERROR"; #endif #include @@ -397,18 +397,18 @@ static int getUDPPackage() if (trb_debug > 2) { fprintf(stderr, "Wait UDP Data\n"); } - + /* Wait for data ready */ - status = pselect(trb3_sockfd, &fds, NULL, NULL, &tv, NULL); + status = pselect(trb3_sockfd + 1, &fds, NULL, NULL, &tv, NULL); if (status == -1) { trb_errno = TRB_TRB3_SOCKET_ERROR; return -1; } - if (status == 0) { + if (FD_ISSET(trb3_sockfd, &fds) == 0) { trb_errno = TRB_TRB3_SOCKET_TIMEOUT; return -1; } - + /* Read Data */ status = recvfrom(trb3_sockfd, (void*)dataBuffer,