diff options
author | Ernst de Haan <znerd@FreeBSD.org> | 2002-08-07 19:44:31 +0000 |
---|---|---|
committer | Ernst de Haan <znerd@FreeBSD.org> | 2002-08-07 19:44:31 +0000 |
commit | 18e35939d7ef3cc5db4a3c6d330e57938ec5c1ec (patch) | |
tree | eed45318717022a76c83a6590b15330c27a65db3 /comms/java-commapi-freebsd/files/patch-ab | |
parent | Fixed the download URL. (diff) |
New port: Java Communication API, FreeBSD implementation.
PR: 31689
Submitted by: Ari Suutari <ari.suutari@syncrontech.com>
Notes
Notes:
svn path=/head/; revision=64167
Diffstat (limited to 'comms/java-commapi-freebsd/files/patch-ab')
-rw-r--r-- | comms/java-commapi-freebsd/files/patch-ab | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/comms/java-commapi-freebsd/files/patch-ab b/comms/java-commapi-freebsd/files/patch-ab new file mode 100644 index 000000000000..29bf69a5a28d --- /dev/null +++ b/comms/java-commapi-freebsd/files/patch-ab @@ -0,0 +1,71 @@ +*** src.orig/org/freebsd/io/comm/libSerial.c Mon Jul 19 08:45:04 1999 +--- src/org/freebsd/io/comm/libSerial.c Mon Jul 2 09:46:38 2001 +*************** +*** 42,47 **** +--- 42,48 ---- + #include <termios.h> + #include <sys/time.h> + #include <sys/ttycom.h> ++ #include <poll.h> + + #define IOEXCEPTION "java/io/IOException" + #define USCOEXCEPTION "javax/comm/UnsupportedCommOperationException" +*************** +*** 579,586 **** + { + int state,old_state; + int fd; +! fd_set rfds; +! struct timeval sleep; + int size; + int ret; + +--- 580,586 ---- + { + int state,old_state; + int fd; +! struct pollfd pollfds; + int size; + int ret; + +*************** +*** 595,605 **** + jthread = (*env)->FindClass( env, "java/lang/Thread" ); + interrupt = (*env)->GetStaticMethodID( env, jthread, "interrupted", "()Z" ); + +! FD_ZERO( &rfds ); +! FD_SET( fd, &rfds ); +! sleep.tv_sec = 1; /* Check every 1 second, or on receive data */ +! sleep.tv_usec = 0; +! + /* Initialization of the current tty state */ + ioctl( fd, TIOCMGET, &old_state); + +--- 595,604 ---- + jthread = (*env)->FindClass( env, "java/lang/Thread" ); + interrupt = (*env)->GetStaticMethodID( env, jthread, "interrupted", "()Z" ); + +! pollfds.fd = fd; +! pollfds.events = POLLIN; +! pollfds.revents = 0; +! + /* Initialization of the current tty state */ + ioctl( fd, TIOCMGET, &old_state); + +*************** +*** 607,613 **** + { + do + { +! ret=select( fd + 1, &rfds, NULL, NULL, &sleep ); + } + while ( (ret < 0) && (errno==EINTR)); + +--- 606,612 ---- + { + do + { +! ret=poll(&pollfds, 1, 1000); + } + while ( (ret < 0) && (errno==EINTR)); + |