autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash fix on Windows/MinGW


From: Paul Eggert
Subject: Re: Crash fix on Windows/MinGW
Date: Fri, 14 Apr 2006 18:14:58 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Eric PAIRE <address@hidden> writes:

> config.log cannot be truncated by configure because
> config.status already opened it (and Windows forbids truncating an
> open file).

That's kind of a weird bug, but the fix seems fairly harmless so
I installed the following.  While installing this I noticed another
glitch in this area: sometimes the log is opened in append mode, and
sometimes not.  It's better to be consistent and open it in append
mode always.  So I fixed that too.

2006-04-14  Paul Eggert  <address@hidden>

        * lib/autoconf/general.m4 (_AC_INIT_CONFIG_LOG): Close
        AS_MESSAGE_LOG_FD before reopening it onto the log file.
        This works around a MinGW bug reported by Eric Paire.
        Make sure that all writes to the log file append to it,
        rather than possibly losing data.
        * lib/autotest/general.m4 (AT_INIT): Likewise.

Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.906
diff -p -u -r1.906 general.m4
--- lib/autoconf/general.m4     10 Apr 2006 09:15:11 -0000      1.906
+++ lib/autoconf/general.m4     15 Apr 2006 01:02:36 -0000
@@ -1103,8 +1103,8 @@ fi])dnl
 m4_define([_AC_INIT_CONFIG_LOG],
 [m4_divert_text([INIT_PREPARE],
 [m4_define([AS_MESSAGE_LOG_FD], 5)dnl
-exec AS_MESSAGE_LOG_FD>config.log
-cat >&AS_MESSAGE_LOG_FD <<_ACEOF
+exec AS_MESSAGE_LOG_FD>&- # Work around a MinGW bug.
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
@@ -1115,6 +1115,7 @@ generated by m4_PACKAGE_STRING.  Invocat
   $ $[0] address@hidden
 
 _ACEOF
+exec AS_MESSAGE_LOG_FD>>config.log
 AS_UNAME >&AS_MESSAGE_LOG_FD
 
 cat >&AS_MESSAGE_LOG_FD <<_ACEOF
Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.209
diff -p -u -r1.209 general.m4
--- lib/autotest/general.m4     11 Apr 2006 16:09:54 -0000      1.209
+++ lib/autotest/general.m4     15 Apr 2006 01:02:36 -0000
@@ -598,8 +598,13 @@ export PATH
 # Setting up the FDs.
 # 5 is the log file.  Not to be overwritten if `-d'.
 m4_define([AS_MESSAGE_LOG_FD], [5])
-$at_debug_p && at_suite_log=/dev/null
-exec AS_MESSAGE_LOG_FD>"$at_suite_log"
+if $at_debug_p; then
+  at_suite_log=/dev/null
+else
+  exec AS_MESSAGE_LOG_FD>&- # Work around a MinGW bug.
+  : >"$at_suite_log"
+fi
+exec AS_MESSAGE_LOG_FD>>"$at_suite_log"
 
 # Banners and logs.
 AS_BOX(m4_defn([AT_TESTSUITE_NAME])[.])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]