Merge branch 'nd/fopen-errors'
authorJunio C Hamano <gitster@pobox.com>
Thu, 22 Jun 2017 21:15:20 +0000 (14:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Jun 2017 21:15:20 +0000 (14:15 -0700)
Hotfix for a topic that is already in 'master'.

* nd/fopen-errors:
configure.ac: loosen FREAD_READS_DIRECTORIES test program

Makefile
configure.ac
index f4848016380058ffdfc01966bc587ca7306415d9..b94cd5633c8ebda7e09874a1012fb75cbccc64e0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,8 @@ all::
 # have been written to the final string if enough space had been available.
 #
 # Define FREAD_READS_DIRECTORIES if you are on a system which succeeds
-# when attempting to read from an fopen'ed directory.
+# when attempting to read from an fopen'ed directory (or even to fopen
+# it at all).
 #
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # This also implies BLK_SHA1.
index 11d083fbe0efa23eee5e56ccdce3b49effd946be..2f55237e65acfcf9b7fed15ac0386d353eaf0105 100644 (file)
@@ -922,9 +922,9 @@ AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
 [
 AC_RUN_IFELSE(
        [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
-               [[char c;
+               [[
                FILE *f = fopen(".", "r");
-               return f && fread(&c, 1, 1, f)]])],
+               return f)]])],
        [ac_cv_fread_reads_directories=no],
        [ac_cv_fread_reads_directories=yes])
 ])