apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r584487 - in /apr/apr/trunk: file_io/netware/pipe.c file_io/os2/pipe.c file_io/unix/pipe.c file_io/win32/pipe.c include/apr_file_io.h include/apr_thread_proc.h include/arch/win32/apr_arch_file_io.h
Date Sun, 14 Oct 2007 10:03:22 GMT


On 10/14/2007 08:00 AM, wrowe@apache.org wrote:
> Author: wrowe
> Date: Sat Oct 13 23:00:00 2007
> New Revision: 584487
> 
> URL: http://svn.apache.org/viewvc?rev=584487&view=rev
> Log:
> Enhance our file_io in APR 1.3 with apr_file_pipe_create_ex(),
> which should replace apr_file_pipe_create() in apr 2.0.  Trivial,
> this sets up blocking and nonblocking flavors of either pipe end.
> Obviously this code shrinks up threadproc/*/proc.c quite nicely.
> 
> This eliminates a major class of portability concerns.  On Win32,
> I take this one step further and fix the pipe creation logic so
> that nonblock pipes are always set to timeout of 0, per Eric's
> earlier proc.c patch.
> 
> 
> Modified:
>     apr/apr/trunk/file_io/netware/pipe.c
>     apr/apr/trunk/file_io/os2/pipe.c
>     apr/apr/trunk/file_io/unix/pipe.c
>     apr/apr/trunk/file_io/win32/pipe.c
>     apr/apr/trunk/include/apr_file_io.h
>     apr/apr/trunk/include/apr_thread_proc.h
>     apr/apr/trunk/include/arch/win32/apr_arch_file_io.h
> 
> Modified: apr/apr/trunk/file_io/netware/pipe.c
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/netware/pipe.c?rev=584487&r1=584486&r2=584487&view=diff
> ==============================================================================
> --- apr/apr/trunk/file_io/netware/pipe.c (original)
> +++ apr/apr/trunk/file_io/netware/pipe.c Sat Oct 13 23:00:00 2007
> @@ -177,6 +177,33 @@
>      return APR_SUCCESS;
>  }
>  
> +APR_DECLARE(apr_status_t) apr_file_pipe_create_ex(apr_file_t **in, 
> +                                                  apr_file_t **out, 
> +                                                  apr_int32_t blocking,
> +                                                  apr_pool_t *pool)
> +{
> +    apr_status_t status;
> +
> +    if ((status = apr_file_pipe_create(in, out, attr->pool)) 
> +               != APR_SUCCESS) {
> +        return status;
> +    }
> +
> +    switch (blocking) {
> +        case APR_FULL_BLOCK:
> +            break;
> +        case APR_READ_BLOCK:
> +            apr_file_pipe_timeout_set(*in, 0);
> +            break;
> +        case APR_WRITE_BLOCK:
> +            apr_file_pipe_timeout_set(*out, 0);
> +            break;
> +        default:
> +            apr_file_pipe_timeout_set(*in, 0);
> +            apr_file_pipe_timeout_set(*out, 0);
> +    }
> +}
> +

This causes the following warning:

file_io/unix/pipe.c: In function 'apr_file_pipe_create_ex':
file_io/unix/pipe.c:248: warning: control reaches end of non-void function

I guess you just missed a

return APR_SUCCESS

as last line of every flavour of apr_file_pipe_create_ex


Regards

RĂ¼diger


Mime
View raw message