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

Re: svn commit: r37615 - trunk/subversion/libsvn_ra_svn

From: Kyle McKay <mackyle_at_gmail.com>
Date: Thu, 7 May 2009 08:37:24 -0700

On May 7, 2009, at 07:53, Bert Huijben wrote:
> Hi Kyle,
> (Sorry for top posting, but my mail client doesn’t allow me to add
> something between the other parts)
> Apr internally never checks a header before calling exit(). It just
> checks the define before #including the specific header named
> stdlib.h, so it requires exit() to be inside stdlib.h or any already
> included header.

So you're saying that it goes ahead and calls exit even when
APR_HAVE_STDLIB_H is false? Because if APR_HAVE_STDLIB_H was false
then stdlib.h wasn't included so exit is not declared.

> Apr defines apr_proc_fork() as a portable way to call fork
> (declared in <apr_thread_proc.h> when APR_HAS_FORK is true)

apr_proc_fork needs extra parameters that fork() doesn't. Since you
seem to be a lot more familiar with apr than I am, maybe you'd care to
submit a patch to modify what's now in trunk?


> Bert
> From: Kyle McKay [mailto:mackyle_at_gmail.com]
> Sent: donderdag 7 mei 2009 15:57
> To: dev_at_subversion.tigris.org
> Subject: Re: svn commit: r37615 - trunk/subversion/libsvn_ra_svn
> On May 7, 2009, at 00:20, Bert Huijben <rhuijben_at_sharpsvn.net> wrote:
> +static apr_status_t detach_child_cleanup(void *data)
> +{
> I don't think we need the two outer #if's. (We only need the check for
> fork()).
> The exit function is declared in stdlib.h. It's not appropriate to
> call it if we haven't included the header where it's defined (hence
> the test for APR_HAVE_STDLIB_H).
> The fork function is declared in unistd.h, it's not appropriate to
> try and call it if we haven't included the header where it's defined
> (hence the test for APR_HAVE_UNISTD_H).
> For this patch it's also not appropriate to call fork if APR isn't
> using it (hence the test for APR_HAS_FORK).
> So the patch code is only compiled in if you have an stdlib.h (for
> exit()) and a unistd.h (for fork()) AND APR is using fork.
> Are you certain that there aren't some APR-supported and Subversion
> supported platforms where APR_HAS_FORK is true but one or the other
> of the standard headers that declare fork/exit are missing? Some
> older systems perhaps...
> These defines check whether a specific header file exist and not if
> functionality exist.
> Actually the tests are there to avoid calling functions for which we
> haven't included the header file which declares them.
> Using these checks is most likely a dumb guess on whether this is
> running on
> a Unix system. (stdlib.h is available on any operating system I know
> and
> probably part of recent C standards).
> Bert
> If stdlib.h is available everywhere, then why does apr define a test
> for it rather than just always use it?
> Since apr does define a test for APR_HAVE_STDLIB_H, that suggests
> apr supports systems without it and that the patch code should too.
> Kyle

Received on 2009-05-07 17:38:22 CEST

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