]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
pselect bug fixed, + 1 was missing
authorhadaq <hadaq>
Wed, 18 Jul 2012 21:49:17 +0000 (21:49 +0000)
committerhadaq <hadaq>
Wed, 18 Jul 2012 21:49:17 +0000 (21:49 +0000)
libtrbnet/trbnet.c

index 9e3d106722dec3274be65cc39ea4aa3078dcb69f..3a3f2f16d6374e97341cd535abf60bf2c3b9dd2f 100644 (file)
@@ -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 <stdlib.h>
@@ -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,