apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: svn commit: r109843 - /apr/apr/trunk/CHANGES /apr/apr/trunk/file_io/unix/fullrw.c /apr/apr/trunk/file_io/unix/readwrite.c /apr/apr/trunk/include/apr_file_io.h /apr/apr/trunk/test/Makefile.in /apr/apr/trunk/test/data /apr/apr/trunk/test/testfile.c
Date Sun, 05 Dec 2004 19:43:06 GMT
On Sun, Dec 05, 2004 at 02:17:31AM -0000, Paul Querna wrote:
> --- apr/apr/trunk/file_io/unix/fullrw.c	(original)
> +++ apr/apr/trunk/file_io/unix/fullrw.c	Sat Dec  4 18:17:30 2004
> @@ -60,3 +60,37 @@
>  
>      return status;
>  }
> +
> +APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile,
> +                                               const struct iovec *vec,
> +                                               apr_size_t nvec,
> +                                               apr_size_t *bytes_written)
> +{
> +    apr_status_t status;
> +    apr_size_t total = 0;
> +
> +    do {
> +        int i;

Should be apr_size_t.

> +	apr_size_t amt;

ASCII character 9! noooo...

> +        status = apr_file_writev(thefile, vec, nvec, &amt);
> + 
> +       /* We assume that writev will only write complete iovec areas.
> +        * Incomplete writes inside a single area are not supported.
> +        * This should be safe according to SuS v2. 

No, there's no such guarantee; the function needs to check for that case
and should probably just call _write_full() on the remainder of that
vector.

Again style nits here:

> +        */
> +        for(i = 0; i < nvec; i++) {

for (

> +            total += vec[i].iov_len;
> +            if(total >= amt) {

if (


Mime
View raw message