apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lucian Adrian Grijincu" <lucian.griji...@gmail.com>
Subject Re: apr_os_dir_put fixes
Date Tue, 11 Dec 2007 16:32:30 GMT
On Dec 11, 2007 6:19 PM, Michael Clark <michael@metaparadigm.com> wrote:
> Michael Clark wrote:
> > Lucian Adrian Grijincu wrote:
> >> I don't know if dir_cleanup should be registered to handle the
> >> cleanup of
> >> this apr_dir_t (I'm against it). I got the apr_os_dir_t from some place
> >> else, I should manage it's death manually.
> >> If I want to let APR call closedir() on this object I can register a
> >> cleanup function for it on the same pool, manually.
> If there was a newer interface added, it might be nice to have an
> 'owner' argument in addition to dirname and let it register the cleanup
> if it is owner.

Yeah, that's nice.

> Otherwise it is not possible to get apr_dir_close to work on one of
> these dirs as dir_cleanup is static and can't be registered manually
> from outside or apr - so you a forced to get lazy cleanup only.
Also it's not part of the interface, so APR is free to diss it, rename
it, inline it etc.

You could have a my_portable_os_kill_dir  function with different
implementations for each platfrom you target.
Register your own killer. If you use a apr_os_dir_t you have platform
specific code anyway (or so I presume), so this shouldn't be too ugly
to integrate.


View raw message