[Top][All Lists]

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

gnulib fclose caused m4 regression for mingw

From: Eric Blake
Subject: gnulib fclose caused m4 regression for mingw
Date: Fri, 29 Apr 2011 17:40:47 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9

I imported the fclose module into m4 just prior to releasing m4 1.4.16,
on the advice of GNULIB_POSIXCHECK.  The gnulib fclose module replaces
fclose if and only if close is also replaced, which is the case on mingw
if sockets might be involved.  However, the fclose module blindly calls
fflush(), even on input streams, and then makes fclose() fail if
fflush() fails (which it does for non-seekable input streams).  Thus,
where m4 on mingw used to use the system fclose() and safely close
stdin, it is now using the replacement fclose() and complaining about an
EBADF failure that fclose() propagated up from an inappropriate
fflush(), then reflecting that into m4 exit status.  In reality, within
the replacement fclose(), the fflush() should only be attempted only
after verifying the stream was doing output or is seekable.  I'm working
on a patch now...

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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