bug-m4
[Top][All Lists]
Advanced

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

Re: m4-1.4.10 breaking autoconf?


From: Thomas Klausner
Subject: Re: m4-1.4.10 breaking autoconf?
Date: Sun, 22 Jul 2007 08:36:09 +0200

On Sat, Jul 21, 2007 at 10:27:04PM -0600, Eric Blake wrote:
> Nevermind - I finally figured it out!  POSIX states "a ``file position
> indicator'' associated with the stream is positioned at the start (byte
> number 0) of the file, unless the file is opened with append mode, in
> which case it is implementation-defined whether the file position
> indicator is initially positioned at the beginning or end of the file."
> And I was using fopen(tmpname, "a+").  In m4 1.4.9, it was followed by a
> rewind(), but that is inherently unsafe (since rewind() can lose data on a
> flush error, but clears the stream error indicator anyway), so I deleted
> it in m4 1.4.10.  The difference between my system and yours, then, must
> be that NetBSD opens files in append mode with the file descriptor at the
> last byte instead of the first byte of the file, and hence, does not read
> any data unless we add an explicit seek.  I never saw the bug because my
> system always opens files at offset 0 (even in append mode), delaying the
> seek to the end until the first write.
> 
> This is the patch, I'm still working on a testsuite addition:

Thank you, this fixes the problem in the cases I tried so far!
I've updated pkgsrc m4 again including this patch, I'll let you know
if other problems appear.
 Thomas




reply via email to

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