]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
fix a serial bug
authoridgay <idgay>
Tue, 5 Jun 2007 21:08:55 +0000 (21:08 +0000)
committeridgay <idgay>
Tue, 5 Jun 2007 21:08:55 +0000 (21:08 +0000)
force 32-bit compilation (JDKs seem to want that)

tools/tinyos/java/serial/Makefile.am
tools/tinyos/java/serial/NativeSerial_linux.cpp

index 7909a9e8c015ac6171cef255679f25ba135867ab..2db55771746e7f0b1bb1db97071ad182678e325b 100644 (file)
@@ -19,7 +19,7 @@ toscomm_dll_SOURCES = \
   TOSComm_wrap.cxx
 
 libtoscomm.so: $(libtoscomm_so_SOURCES)
-       $(CXX) -O2 -shared -fPIC "-I$(JDK)/include" "-I$(JDK)/include/linux" \
+       $(CXX) -m32 -O2 -shared -fPIC "-I$(JDK)/include" "-I$(JDK)/include/linux" \
          -o $@ NativeSerial_linux.cpp
 
 toscomm.dll: $(toscomm_dll_SOURCES)
index 7e66a910adf8aa625749d254006f1c7f2a04fbb2..76b1fee3e6b7d7eda94cd73fad4681e8cd09874b 100644 (file)
@@ -348,22 +348,23 @@ note( "waitForEvent begin" );
     fd_set input;
     struct timeval tv;
     m_events_out = 0;
+    int fd = m_fd;
 
     while( m_wait_for_events && (m_fd != -1) && (m_events_out == 0) )
     {
       FD_ZERO( &input );
-      FD_SET( m_fd, &input );
+      FD_SET( fd, &input );
       tv.tv_sec = 0;
       tv.tv_usec = 100*1000; // 1ms is the minimum resolution, at best
 
-      if( select( m_fd+1, &input, NULL, NULL, &tv ) == -1 )
+      if( select( fd+1, &input, NULL, NULL, &tv ) == -1 )
       {
        if( errno == EINTR )
          break;
        errno_wrap( true, "waitForEvent.select" );
       }
 
-      if( FD_ISSET( m_fd, &input ) )
+      if( FD_ISSET( fd, &input ) )
        m_events_out |= DATA_AVAILABLE;
     }