diff options
author | Eric Blake <eblake@redhat.com> | 2013-03-09 18:04:59 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2013-03-11 09:18:23 -0600 |
commit | 11199a26f8d5d69a8a748e63f94e59f718278515 (patch) | |
tree | 29e82f6fa7e5915616e987caa54d90575bb5c683 | |
parent | 6b459f609114e1ff3777d3b455a960c1543de3b3 (diff) | |
download | m4-11199a26f8d5d69a8a748e63f94e59f718278515.tar.gz |
build: fix large diversions on mingw
Gnulib's clean-temp module defaults to using _O_TEMPORARY on mingw,
which has the effect of deleting a file the first time it is closed.
This resulted in a testsuite failure in 146.diversions, with m4
complaining that it could not create a temporary file for holding a
diversion. In reality, m4 was trying to rename the file, but
because mingw does not allow renaming an open file, we have to close
it first - but closing it first deleted the file.
For now, we will just work around the gnulib issue by disabling the
use of _O_TEMPORARY.
This was probably introduced in commit da5f6db (1.4.13), although
my testing environment was painfully slow to confirm this, so I
did not call out a 'regression since xyz' in the NEWS entry.
* gl/lib/clean-temp.c.diff: New file.
Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | gl/lib/clean-temp.c.diff | 14 |
3 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2013-03-11 Eric Blake <eblake@redhat.com> + + build: fix large diversions on mingw + * gl/lib/clean-temp.c.diff: New file. + * NEWS: Mention the fix. + 2013-03-08 Gary V. Vaughan <gary@gnu.org> bootstrap: remove reintroduced CVS cruft. @@ -4,6 +4,9 @@ GNU M4 NEWS - User visible changes. ** Fix compilation with newer glibc headers. +** Fix a failure with diverting large amounts of text on mingw (does + not affect platforms that can rename an open file). + ** A number of portability improvements inherited from gnulib. diff --git a/gl/lib/clean-temp.c.diff b/gl/lib/clean-temp.c.diff new file mode 100644 index 00000000..2eafde69 --- /dev/null +++ b/gl/lib/clean-temp.c.diff @@ -0,0 +1,14 @@ +diff --git i/lib/clean-temp.c w/lib/clean-temp.c +index 40ec02f..1053312 100644 +--- i/lib/clean-temp.c ++++ w/lib/clean-temp.c +@@ -582,6 +582,9 @@ static bool + supports_delete_on_close () + { + static int known; /* 1 = yes, -1 = no, 0 = unknown */ ++ /* M4 wants to close and later reopen a temporary file, so ++ delete-on-close must not be used. */ ++ known = -1; + if (!known) + { + OSVERSIONINFO v; |