]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
fixed fuck-bug (fds)
authorhadaq <hadaq>
Thu, 19 Jul 2012 23:46:23 +0000 (23:46 +0000)
committerhadaq <hadaq>
Thu, 19 Jul 2012 23:46:23 +0000 (23:46 +0000)
libtrbnet/trbnet.c

index c3e1555119813d78ec869f4672033b01549c1855..9e2b0c4e77b385aa7938e19310d8028bdd19beac 100644 (file)
@@ -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 <stdlib.h>
@@ -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;