From: Brandon Casey Date: Wed, 22 Apr 2020 19:05:57 GMT Subject: Re: [PATCH] config.mak.uname: Define FREAD_READS_DIRECTORIES for GNU/Hurd Message-ID: In-Reply-To: <452EC7D1-BE96-4172-8F70-3E7384C87280@jrtc27.com> On Wed, Apr 22, 2020 at 11:50 AM Jessica Clarke wrote: > > On 22 Apr 2020, at 19:48, Brandon Casey wrote: > > 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