classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for gnu_java_net_PlainDatagramSocketImpl.c


From: Archie Cobbs
Subject: Re: Patch for gnu_java_net_PlainDatagramSocketImpl.c
Date: Fri, 29 Oct 2004 08:49:15 -0500 (CDT)

Dr. Torsten Rupp wrote:
> gnu_java_net_PlainDatagramSocketImpl.c seems to contain a small error. 
> Please find a patch below. I also changed "this" into "thiz" for 
> C++-compatibility in gnu_java_net_PlainDatagramSocketImpl.c and 
> gnu_java_net_PlainSocketImpl.c .
> 
> -Java_gnu_java_net_PlainDatagramSocketImpl_receive0(JNIEnv *env, jobject 
> this, 
> +Java_gnu_java_net_PlainDatagramSocketImpl_receive0(JNIEnv *env, jobject 
> thiz, 
>                                                jobject packet)
>  {
>  #ifndef WITHOUT_NETWORK
> -  int  addr, port, bytes_read;
> -  unsigned int maxlen, offset;
> +  int           addr, port;
> +  unsigned int  maxlen, offset, bytes_read;
>    jclass        cls, addr_cls;
>    jfieldID   fid;
>    jmethodID     mid;
> @@ -242,7 +243,7 @@
>  
>    /* Receive the packet */
>    /* should we try some sort of validation on the length? */
> -  bytes_read = _javanet_recvfrom(env, this, arr, offset, maxlen, &addr, 
> &port); 
> +  bytes_read = _javanet_recvfrom(env, thiz, arr, offset, maxlen, &addr, 
> &port); 
>    if ((bytes_read == -1) || (*env)->ExceptionOccurred(env))
>      {
>        JCL_ThrowException(env, IO_EXCEPTION, "Internal error: receive");

You changed bytes_read to an unsigned int, yet you are still comparing
it to -1 .. so something seems not quite right.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]