From owner-freebsd-java Tue Oct 22 5: 0:18 2002 Delivered-To: freebsd-java@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83D3D37B401 for ; Tue, 22 Oct 2002 05:00:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 159DE43E6E for ; Tue, 22 Oct 2002 05:00:12 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9MC0Bx3071482 for ; Tue, 22 Oct 2002 05:00:11 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9MC0BxE071481; Tue, 22 Oct 2002 05:00:11 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B044E37B401 for ; Tue, 22 Oct 2002 04:53:17 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D6F743E6A for ; Tue, 22 Oct 2002 04:53:17 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9MBrF7R045945 for ; Tue, 22 Oct 2002 04:53:15 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g9MBrF9d045944; Tue, 22 Oct 2002 04:53:15 -0700 (PDT) Message-Id: <200210221153.g9MBrF9d045944@www.freebsd.org> Date: Tue, 22 Oct 2002 04:53:15 -0700 (PDT) From: huang wen hui To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: java/44380: patch for java-commapi-freebsd Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44380 >Category: java >Synopsis: patch for java-commapi-freebsd >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-java >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 22 05:00:11 PDT 2002 >Closed-Date: >Last-Modified: >Originator: huang wen hui >Release: 4.6-STABLE >Organization: gddsn >Environment: FreeBSD wfdb.gddsn.org.cn 4.6-STABLE FreeBSD 4.6-STABLE #4: Sun Jul 21 20:43:12CST 2002 hwh@wfdb.gddsn.org.cn:/usr/obj/usr/src/sys/WFDB i386 >Description: 1. com port could not receive correct data, because patch is wrong 2. ComPort.getName() return null. >How-To-Repeat: Use /usr/ports/comms/java-commapi-freebsd. >Fix: *** libSerial.c.orig Mon Jul 19 11:45:04 1999 --- src/org/freebsd/io/comm/libSerial.c Feb 22 11:19:43 2002 *************** *** 42,47 **** --- 42,48 ---- #include #include #include + #include #define IOEXCEPTION "java/io/IOException" #define USCOEXCEPTION "javax/comm/UnsupportedCommOperationException" *************** *** 420,426 **** jboolean isCopy; bytes = (*env)->GetByteArrayElements (env, b, &isCopy); ! ret = read ((int)sd, bytes, (size_t)length); (*env)->ReleaseByteArrayElements (env, b, bytes, 0); return (ret); } --- 421,427 ---- jboolean isCopy; bytes = (*env)->GetByteArrayElements (env, b, &isCopy); ! ret = read ((int)sd, bytes + offset, (size_t)length); (*env)->ReleaseByteArrayElements (env, b, bytes, 0); return (ret); } *************** *** 438,444 **** jboolean isCopy; bytes = (*env)->GetByteArrayElements (env, b, &isCopy); ! ret = write ((int)sd, bytes, (size_t)length); tcdrain ((int)sd); (*env)->ReleaseByteArrayElements (env, b, bytes, 0); return (ret); --- 439,445 ---- jboolean isCopy; bytes = (*env)->GetByteArrayElements (env, b, &isCopy); ! ret = write ((int)sd, bytes + offset, (size_t)length); tcdrain ((int)sd); (*env)->ReleaseByteArrayElements (env, b, bytes, 0); return (ret); *************** *** 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)); --- src/org/freebsd/io/comm/FreebsdSerial.java.org Tue Oct 22 19:16:52 2002 +++ src/org/freebsd/io/comm/FreebsdSerial.java Tue Oct 22 19:17:15 2002 @@ -47,7 +47,7 @@ private int parity = SerialPort.PARITY_NONE; private int flowcontrol = SerialPort.FLOWCONTROL_NONE; private int sd = -1; - private String name = null; + //private String name = null; private int ibs = 1024; private int obs = 1024; private int framing = -1; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message