[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: File permissions problems with 1.4.0 (yet again!)

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-01-16 19:07:06 CET

On Tue, 16 Jan 2007, Daniel Rall wrote:

> 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
> achieved.
>
> 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.

My K & R (2nd edition, updated for ANSI C) indicates that errno.h is a
standard header of the C environment (though not part of the C
language itself, obviously). Not sure how this bears out with
Subversion's base requirements.

  • application/pgp-signature attachment: stored
Received on Tue Jan 16 19:07:15 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.