git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] autoconf: Test FREAD_READS_DIRECTORIES

From
MRMichal Rokos <michal.rokos@nextsoft.cz>
Date
Mar 4, 2008, 15:30 UTC
Message-ID
<200803041630.07585.michal.rokos@nextsoft.cz>
In-Reply-To
<alpine.LSU.1.00.0803041458220.22527@racer.site>
Hello,
On Tuesday 04 March 2008 15:59:02 Johannes Schindelin wrote:
Show 11 quoted lines
> On Tue, 4 Mar 2008, Michal Rokos wrote:
> > +AC_RUN_IFELSE(
> > +	[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
> > +		[[char c;
> > +		FILE *f = fopen(".", "r");
> > +		if (! f) return 0;
> > +		if (f && fread(&c, 1, 1, f) > 0) return 1]])],
> > +	[ac_cv_fread_reads_directories=no],
> > +	[ac_cv_fread_reads_directories=yes])
>
> I do not see the issue addressed that I saw on msysGit.

ahh, sorry I've included some old one. Now it's +AC_RUN_IFELSE( + [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], + [[char c; + FILE *f = fopen(".", "r"); + return f && fread(&c, 1, 1, f)]])], + [ac_cv_fread_reads_directories=no], + [ac_cv_fread_reads_directories=yes])

I've tried to reproduce, but I failed to do so. When I put "return 0;" it detect that "no"; when I return something else, "yes" is detected - as it should.

The C snippet in configure script looks like:
$ac_includes_default
int
main ()
{
char c;
                FILE *f = fopen(".", "r");
                return f && fread(&c, 1, 1, f)
  ;
  return 0;
}
Does your autoconf create the same thing?
Michal
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 6 in “autoconf: Test FREAD_READS_DIRECTORIES”
  1. autoconf: Test FREAD_READS_DIRECTORIESMichal Rokos, Mar 4, 2008
  2. Johannes SchindelinMar 4, 2008
  3. Michal RokosMar 4, 2008
  4. Johannes SchindelinMar 4, 2008
  5. Mike RalphsonMar 4, 2008
  6. Fwd: [PATCH v3] autoconf: Test FREAD_READS_DIRECTORIESMike Ralphson, Mar 4, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.