Re: [PATCH] config.mak.uname: Define FREAD_READS_DIRECTORIES for GNU/Hurd
- From
Brandon Casey <drafnel@gmail.com>
- Date
- Apr 22, 2020, 19:05 UTC
- Message-ID
- <CA+sFfMdudQ-cWbXajQ_92LZLOOOnTxmQmmsUo3dY1eKCL5-Y6Q@mail.gmail.com>
- In-Reply-To
- <452EC7D1-BE96-4172-8F70-3E7384C87280@jrtc27.com>
On Wed, Apr 22, 2020 at 11:50 AM Jessica Clarke <jrtc27@jrtc27.com> wrote:
> > On 22 Apr 2020, at 19:48, Brandon Casey <drafnel@gmail.com> wrote:
Show 15 quoted lines
> > introduced
> > this feature that would make fopen() fail when opening a directory for
> > use on the platforms where fread() of a directory did not fail,
> > instead of trying to wrap fread().
>
> Then the current autoconf test is wrong and likely causing confusion:
>
> > AC_RUN_IFELSE(
> > [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
> > [[
> > FILE *f = fopen(".", "r");
> > return f != NULL;]])],
> > [ac_cv_fread_reads_directories=no],
> > [ac_cv_fread_reads_directories=yes])
> > ])Yes, we should attempt to call fread() there. If either the fopen() fails or the fread() fails, then that should mean that FREAD_READS_DIRECTORIES is not necessary.
-Brandon