kern/56274: pthreads does not return correct value at EOT
Dan Langille
dan at langille.org
Sun Sep 7 16:50:15 PDT 2003
The following reply was made to PR kern/56274; it has been noted by GNATS.
From: "Dan Langille" <dan at langille.org>
To: FreeBSD-gnats-submit at 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/
More information about the freebsd-bugs
mailing list