apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Nicholes" <BNICHO...@novell.com>
Subject Re: svn commit: r540040 - in /apr/apr/branches/0.9.x: CHANGES file_io/netware/mktemp.c file_io/unix/filedup.c file_io/unix/mktemp.c file_io/unix/open.c include/arch/netware/apr_arch_file_io.h include/arch/unix/apr_arch_file_io.h
Date Mon, 21 May 2007 15:14:47 GMT
>>> On 5/21/2007 at 12:49 AM, in message
<20070521064956.877481A981D@eris.apache.org>, <bojan@apache.org> wrote:
> Author: bojan
> Date: Sun May 20 23:49:55 2007
> New Revision: 540040
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=540040 
> Log:
> Backport r538045 from the trunk.
> Discard file buffers when running cleanups for exec.
> PR 41119.
> Original patches by Davi Arnaut.
> 
> Modified:
>     apr/apr/branches/0.9.x/CHANGES
>     apr/apr/branches/0.9.x/file_io/netware/mktemp.c
>     apr/apr/branches/0.9.x/file_io/unix/filedup.c
>     apr/apr/branches/0.9.x/file_io/unix/mktemp.c
>     apr/apr/branches/0.9.x/file_io/unix/open.c
>     apr/apr/branches/0.9.x/include/arch/netware/apr_arch_file_io.h
>     apr/apr/branches/0.9.x/include/arch/unix/apr_arch_file_io.h
> 

...

> Modified: apr/apr/branches/0.9.x/file_io/unix/open.c
> URL: 
> http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/file_io/unix/open.c?view= 
> diff&rev=540040&r1=540039&r2=540040
> ============================================================================
> ==
> --- apr/apr/branches/0.9.x/file_io/unix/open.c (original)
> +++ apr/apr/branches/0.9.x/file_io/unix/open.c Sun May 20 23:49:55 2007
...
> @@ -262,6 +277,22 @@
>  
>  APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup)
>  
> -APR_IMPLEMENT_INHERIT_UNSET(file, flags, pool, apr_unix_file_cleanup)
> +/* We need to do this by hand instead of using APR_IMPLEMENT_INHERIT_UNSET
> + * because the macro sets both cleanups to the same function, which is not
> + * suitable on Unix (see PR 41119). */
> +APR_DECLARE(apr_status_t) apr_file_inherit_unset(apr_file_t *thefile)
> +{
> +    if (thefile->flags & APR_FILE_NOCLEANUP) {
> +        return APR_EINVAL;
> +    }
> +    if (thefile->flags & APR_INHERIT) {
> +        thefile->flags &= ~APR_INHERIT;
> +        apr_pool_child_cleanup_set(thefile->pool,
> +                                   (void *)thefile,
> +                                   apr_unix_file_cleanup,
> +                                   apr_unix_child_file_cleanup);
> +    }
> +    return APR_SUCCESS;
> +}
>  
>  APR_POOL_IMPLEMENT_ACCESSOR(file)
> 

Replacing the macro APR_IMPLEMENT_INHERIT_UNSET with a real function, also removed the small
macro that creates the deprecated function apr_file_unset_inherit().  Although this function
is deprecated, it is still being used.  At least the NetWare build of httpd no longer compiles
because it can't find apr_file_unset_inherit().  You will probably need to reimplement this
deprecated function for APR 0.9.x.

Brad


Mime
View raw message