On 4 Dec 2004 23:40:37 -0000, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Author: pquerna
> Date: Sat Dec  4 15:40:37 2004
> New Revision: 109832
> 
> URL: http://svn.apache.org/viewcvs?view=rev&rev=109832
> Log:
> * test/testfile.c: Add a test for apr_file_writev().
> * file_io/unix/readwrite.c: Try to write all iovecs out on platforms without 
> writev.
> 
> Modified:
>    apr/apr/trunk/CHANGES
>    apr/apr/trunk/file_io/unix/readwrite.c
>    apr/apr/trunk/test/Makefile.in
>    apr/apr/trunk/test/data/   (props changed)
>    apr/apr/trunk/test/testfile.c
> 
> Modified: apr/apr/trunk/CHANGES
> Url: 
> http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?view=diff&rev=109832&p1=apr/apr/trunk/CHANGES&r1=109831&p2=apr/apr/trunk/CHANGES&r2=109832
> ==============================================================================
> --- apr/apr/trunk/CHANGES       (original)
> +++ apr/apr/trunk/CHANGES       Sat Dec  4 15:40:37 2004
> @@ -1,5 +1,9 @@
>  Changes for APR 1.1.0
> 
> +  *) apr_file_writev will now at least try to write all iovecs on platforms
> +     that do not support writev.
> +     [Paul Querna]
> +
>    *) Remove the runtime test for Sendfile versions on FreeBSD. PR 25718.
>       [Mike Silbersack <silby silby.com>, Paul Querna]
> 
> Modified: apr/apr/trunk/file_io/unix/readwrite.c
> Url: 
> http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/unix/readwrite.c?view=diff&rev=109832&p1=apr/apr/trunk/file_io/unix/readwrite.c&r1=109831&p2=apr/apr/trunk/file_io/unix/readwrite.c&r2=109832
> ==============================================================================
> --- apr/apr/trunk/file_io/unix/readwrite.c      (original)
> +++ apr/apr/trunk/file_io/unix/readwrite.c      Sat Dec  4 15:40:37 2004
> @@ -241,8 +241,17 @@
>          return APR_SUCCESS;
>      }
>  #else
> -    *nbytes = vec[0].iov_len;
> -    return apr_file_write(thefile, vec[0].iov_base, nbytes);
> +    int i, tbytes;
> +    apr_status_t rv = APR_SUCCESS;
> +
> +    for(i = 0; i < nvec; i++){

what is with the style here?

> +         tbytes = vec[i].iov_len;
> +         rv = apr_file_write(thefile, vec[i].iov_base, &tbytes);
> +         *nbytes += tbytes;
> +         if(rv != APR_SUCCESS)

style

we're hosed here if apr_file_write() can only write part of the data
(tbytes is < vec[i].iov_len and rv is APR_SUCCESS); don't you also
need to bail if tbytes < vec[i].iov_len?

> +             break;
> +    }
> +    return rv;
>  #endif
>  }

Reply via email to