Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Sep 2003 16:50:15 -0700 (PDT)
From:      "Dan Langille" <dan@langille.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/56274: pthreads does not return correct value at EOT
Message-ID:  <200309072350.h87NoFPL088228@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/56274; it has been noted by GNATS.

From: "Dan Langille" <dan@langille.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/56274: pthreads does not return correct value at EOT
Date: Sun, 07 Sep 2003 19:48:37 -0400

 Here is the suggested patch.
 
 --- uthread_write.c.org	Sun Sep  7 10:58:31 2003
 +++ uthread_write.c	Sun Sep  7 15:41:34 2003
 @@ -93,7 +93,7 @@
  			 * write:
  			 */
  			if (blocking && ((n < 0 && (errno == EWOULDBLOCK ||
 -			    errno == EAGAIN)) || (n >= 0 && num < nbytes))) {
 +			    errno == EAGAIN)) || (n > 0 && num < nbytes))) {
  				curthread->data.fd.fd = fd;
  				_thread_kern_set_timeout(NULL);
  
 @@ -131,7 +131,7 @@
  			 * If there was an error, return partial success
  			 * (if any bytes were written) or else the error:
  			 */
 -			} else if (n < 0) {
 +			} else if (n <= 0) {
  				if (num > 0)
  					ret = num;
  				else
 
 -- 
 Dan Langille : http://www.langille.org/
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309072350.h87NoFPL088228>