This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: fhandler_base::readv
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 23 May 2006 21:00:02 -0400
- Subject: Re: fhandler_base::readv
- References: <ba40711f0605231728r3e349fd4m93b82a70ae058146@mail.gmail.com>
- Reply-to: cygwin-patches at cygwin dot com
On Tue, May 23, 2006 at 08:28:58PM -0400, Lev Bishop wrote:
>2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
>
> * fhandler.cc (readv): Deal with tot not precalculated.
>Index: fhandler.cc
>===================================================================
>RCS file: /cvs/src/src/winsup/cygwin/fhandler.cc,v
>retrieving revision 1.251
>diff -u -p -r1.251 fhandler.cc
>--- fhandler.cc 22 Mar 2006 16:42:44 -0000 1.251
>+++ fhandler.cc 24 May 2006 00:24:46 -0000
>@@ -964,6 +964,7 @@ fhandler_base::readv (const struct iovec
> len += iovptr->iov_len;
> }
> while (iovptr != iov);
>+ tot = len;
> }
>
> assert (tot >= 0);
At this point in the code, tot is only used in the subsequent assert.
If that is the rationale for this change wouldn't it make more sense to
just check len in the assert?
cgf