{"thread":{"id":"12491","subject":"[PATCH v2] Configure test for FREAD_READS_DIRECTORIES","startedAt":"2008-03-04T11:44:11Z","lastAt":"2008-03-04T13:43:42Z","messageCount":3,"participants":["Michal Rokos","Johannes Schindelin"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"70925","messageId":"200803041244.11315.michal.rokos@nextsoft.cz","threadId":"12491","inReplyTo":null,"subject":"[PATCH v2] Configure test for FREAD_READS_DIRECTORIES","fromName":"Michal Rokos","fromEmail":"michal.rokos@nextsoft.cz","sentAt":"2008-03-04T11:44:11Z","receivedAt":"2008-03-04T11:44:11Z","isPatch":true,"sender":{"key":"michal.rokos@nextsoft.cz","avatar":null},"body":"Hello,\n\nthis patch adds missing tests for FREAD_READS_DIRECTORIES.\n\nCould anyone volunteer to test it on different platforms?\nSo far I know it works well on Linux (no FREAD_READS_DIRECTORIES),\nHP-UXes 11.11 and 11.23 (FREAD_READS_DIRECTORIES defined).\n\nThanks\n\nMR\n\nSigned-off-by: Michal Rokos <michal.rokos@nextsoft.cz>\n\ndiff --git a/Makefile b/Makefile\nindex ca5aad9..344ab49 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -526,6 +526,7 @@ ifeq ($(uname_S),HP-UX)\n \tNO_UNSETENV = YesPlease\n \tNO_HSTRERROR = YesPlease\n \tNO_SYS_SELECT_H = YesPlease\n+\tFREAD_READS_DIRECTORIES = UnfortunatelyYes\n endif\n ifneq (,$(findstring arm,$(uname_M)))\n \tARM_SHA1 = YesPlease\ndiff --git a/config.mak.in b/config.mak.in\nindex ee6c33d..516c468 100644\n--- a/config.mak.in\n+++ b/config.mak.in\n@@ -46,3 +46,4 @@ NO_MKDTEMP=@NO_MKDTEMP@\n NO_ICONV=@NO_ICONV@\n OLD_ICONV=@OLD_ICONV@\n NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@\n+FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@\ndiff --git a/configure.ac b/configure.ac\nindex 85d7ef5..8f748a9 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -326,6 +326,27 @@ else\n \tNO_C99_FORMAT=\n fi\n AC_SUBST(NO_C99_FORMAT)\n+#\n+# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds\n+# when attempting to read from an fopen'ed directory.\n+AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],\n+ [ac_cv_fread_reads_directories],\n+[\n+AC_RUN_IFELSE(\n+\t[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],\n+\t\t[[char c;\n+\t\tFILE *f = fopen(\".\", \"r\");\n+\t\tif (! f) return 0;\n+\t\tif (f && fread(&c, 1, 1, f) > 0) return 1]])],\n+\t[ac_cv_fread_reads_directories=no],\n+\t[ac_cv_fread_reads_directories=yes])\n+])\n+if test $ac_cv_fread_reads_directories = yes; then\n+\tFREAD_READS_DIRECTORIES=UnfortunatelyYes\n+else\n+\tFREAD_READS_DIRECTORIES=\n+fi\n+AC_SUBST(FREAD_READS_DIRECTORIES)\n \n \n ## Checks for library functions.\n\n"},{"id":"70932","messageId":"alpine.LSU.1.00.0803041204490.22527@racer.site","threadId":"12491","inReplyTo":"200803041244.11315.michal.rokos@nextsoft.cz","subject":"Re: [PATCH v2] Configure test for FREAD_READS_DIRECTORIES","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-04T12:05:11Z","receivedAt":"2008-03-04T12:05:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 4 Mar 2008, Michal Rokos wrote:\n\n> Hello,\n\nthis is still wrong in the commit message.\n\nI will test on msysGit in a moment.\n\nCiao,\nDscho\n"},{"id":"70940","messageId":"alpine.LSU.1.00.0803041332580.22527@racer.site","threadId":"12491","inReplyTo":"alpine.LSU.1.00.0803041204490.22527@racer.site","subject":"Re: [PATCH v2] Configure test for FREAD_READS_DIRECTORIES","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-04T13:43:42Z","receivedAt":"2008-03-04T13:43:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 4 Mar 2008, Johannes Schindelin wrote:\n\n> I will test on msysGit in a moment.\n\nUnfortunately, \"autoconf\" does not work in msysGit at the moment.\n\nHowever, applying this patch on Linux, extracting the product of \"make \ndist\" on msysGit, and running \"./configure\" yields this:\n\n...\nchecking whether system succeeds to read fopen'ed directory... yes\n...\n\nAnd indeed, FREAD_READS_DIRECTORIES is set in config.mak.autogen.  \nHowever, \"f\" was NULL in your test, so I am not quite sure what is going \nwrong...\n\nBesides, you miss a return 0 in the end, I think.  Or even better: you \nshould\n\n\treturn f && fread(&c, 1, 1, f);\n\nBTW the commit message looks like this here... not nice (the commit log \nis not a mailing list):\n\ncommit 67418ff5d4f548f7de23e97bf165a8529ebf6a31\nAuthor: Michal Rokos <michal.rokos@nextsoft.cz>\nDate:   Tue Mar 4 12:44:11 2008 +0100\n\n    Configure test for FREAD_READS_DIRECTORIES\n\n    Hello,\n\n    this patch adds missing tests for FREAD_READS_DIRECTORIES.\n\n    Could anyone volunteer to test it on different platforms?\n    So far I know it works well on Linux (no FREAD_READS_DIRECTORIES),\n    HP-UXes 11.11 and 11.23 (FREAD_READS_DIRECTORIES defined).\n\n    Thanks\n\n    MR\n\n    Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>\n\n\nCiao,\nDscho\n\n"}]}