* [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES
@ 2008-03-09 20:44 Michal Rokos
2008-03-10 6:21 ` Junio C Hamano
2008-03-10 15:46 ` Johannes Schindelin
0 siblings, 2 replies; 4+ messages in thread
From: Michal Rokos @ 2008-03-09 20:44 UTC (permalink / raw)
To: GIT
Add test for FREAD_READS_DIRECTORIES to detect when fread() reads fopen'ed
directory.
Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
diff --git a/config.mak.in b/config.mak.in
index 8e1cd5f..7868dfd 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -46,4 +46,5 @@ NO_MKDTEMP=@NO_MKDTEMP@
NO_ICONV=@NO_ICONV@
OLD_ICONV=@OLD_ICONV@
NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
+FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
diff --git a/configure.ac b/configure.ac
index 287149d..82584e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -327,6 +327,26 @@ else
fi
AC_SUBST(NO_C99_FORMAT)
#
+# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
+# when attempting to read from an fopen'ed directory.
+AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
+ [ac_cv_fread_reads_directories],
+[
+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])
+])
+if test $ac_cv_fread_reads_directories = yes; then
+ FREAD_READS_DIRECTORIES=UnfortunatelyYes
+else
+ FREAD_READS_DIRECTORIES=
+fi
+AC_SUBST(FREAD_READS_DIRECTORIES)
+#
# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
# or vsnprintf() return -1 instead of number of characters which would
# have been written to the final string if enough space had been available.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES
2008-03-09 20:44 [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES Michal Rokos
@ 2008-03-10 6:21 ` Junio C Hamano
2008-03-10 8:54 ` Michal Rokos
2008-03-10 15:46 ` Johannes Schindelin
1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-03-10 6:21 UTC (permalink / raw)
To: Michal Rokos; +Cc: GIT
Looks fine to me. I was not keeping on an close eye on the discussion,
however. Can we have a list of platforms we saw success stories on, so
that I can mention them when I queue this?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES
2008-03-10 6:21 ` Junio C Hamano
@ 2008-03-10 8:54 ` Michal Rokos
0 siblings, 0 replies; 4+ messages in thread
From: Michal Rokos @ 2008-03-10 8:54 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT
On Monday 10 March 2008 07:21:27 Junio C Hamano wrote:
> Looks fine to me. I was not keeping on an close eye on the discussion,
> however. Can we have a list of platforms we saw success stories on, so
> that I can mention them when I queue this?
Linux 2.6.25-rc4 - FREAD_READS_DIRECTORIES=
Tested-by: Michal Rokos <michal.rokos@nextsoft.cz>
HP-UX B.11.11 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
Tested-by: Michal Rokos <michal.rokos@nextsoft.cz>
HP-UX B.11.23 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
Tested-by: Michal Rokos <michal.rokos@nextsoft.cz>
AIX 5.3 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Tru64 V5.1 - FREAD_READS_DIRECTORIES=UnfortunatelyYes
Tested-by: Michal Rokos <michal.rokos@nextsoft.cz>
--
Michal Rokos
NextSoft s.r.o.
Vyskočilova 1/1410
140 21 Praha 4
phone: +420 267 224 311
fax: +420 267 224 307
mobile: +420 736 646 591
e-mail: michal.rokos@nextsoft.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES
2008-03-09 20:44 [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES Michal Rokos
2008-03-10 6:21 ` Junio C Hamano
@ 2008-03-10 15:46 ` Johannes Schindelin
1 sibling, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2008-03-10 15:46 UTC (permalink / raw)
To: Michal Rokos; +Cc: GIT
Hi,
On Sun, 9 Mar 2008, Michal Rokos wrote:
> Add test for FREAD_READS_DIRECTORIES to detect when fread() reads fopen'ed
> directory.
>
> Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
> Tested-by: Mike Ralphson <mike@abacus.co.uk>
Okay, I just forced the stupid "socket in -lc" test to succeed, and now
your patch does exactly what it is supposed to on MinGW (it says that
fopen()ed directories cannot be read).
Of course, the building blocks are not in place, so I cannot compile on
MinGW, but that is another issue.
So, you can readd my Tested-by: ;-)
Thanks,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-03-10 15:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-09 20:44 [PATCH v6] autoconf: Test FREAD_READS_DIRECTORIES Michal Rokos
2008-03-10 6:21 ` Junio C Hamano
2008-03-10 8:54 ` Michal Rokos
2008-03-10 15:46 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).