On Tue, 16 Jan 2007, C. Michael Pilato wrote:
> Miller, Eric wrote:
> > Ok, here is the bug:
> > io.c is missing #include <errno.h> at line 26.
> > This is causing EPERM to be undefined, making APR_STATUS_IS_EPERM always
> > return 0 thus io_set_file_perms() is never called.
> > Once errno.h is included the reown functionality behaves like it used
> > to.
> > Too late for 1.4.3??
> I'm totally not following this thread, so forgive me if I'm adding
> nothing but noise to it. But glancing at the code, I'm wondering if
> the correct fix is *not* to add
> #include <errno.h>
> to io.c, but instead to simply move the #ifndef APR_STATUS_IS_EPERM
> block to *after* the inclusion of the APR headers. Most of the APR
> headers already include apr_errno.h, which includes errno.h on
> platforms that have it.
Sadly, apr_errno.h does not define the APR_STATUS_IS_EPERM() macro.
Meaning, we *always* define APR_STATUS_IS_EPERM() in io.c, which
requires that EPERM be available for a meaningful definition to be
I'm not a fan of relying on apr_errno.h's hidden inclusion of errno.h,
and would prefer an explicit include (as we used to do). I don't have
a preference as to where this happens, though Max Bowsher suggested
moving it down to after the inclusion of apr_errno.h.
That said, I don't see us including errno.h explicitly anywhere else
in the code base. We only include apr_errno.h, but do reference
variables declared by errno.h, so there's certainly plent of precedent
for Mike's approach.
Received on Tue Jan 16 18:57:42 2007
- application/pgp-signature attachment: stored