[Patch, libfortran] PR 30162 pipe I/O regression with 4.7/4.8

Janne Blomqvist blomqvist.janne@gmail.com
Tue Feb 19 22:40:00 GMT 2013


Hi,

attached is an attempt to fix writing formatted sequential I/O to a
pipe (The PR was reopened in comment #22, which refers to formatted
I/O so the PR title is incorrect). I think the underlying reason was
that the introduction of the ssize() member function led to a change
in semantics (size of a non-seekable fd is now 0 rather than -1), and
thus in io/open.c test_endfile() we incorrectly concluded that the
file was not positioned at the end, and thus we try to truncate after
writing, leading to the failure.

At the same time, the patch reverts the previous fix; Unformatted
sequential requires seeking due to updating the record markers, I
think that issue can be closed as WONTFIX.

Regtested on x86_64-unknown-linux-gnu, Ok for trunk/4.7?

2013-02-19  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/30162
	* io/open.c (test_endfile): Call stell only if size != 0.
	* io/unix.c (raw_tell): Revert r194679.
	(raw_size): Return size field only for regular files, otherwise 0.


-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pipe2.diff
Type: application/octet-stream
Size: 1294 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130219/dfdd5ee9/attachment.obj>


More information about the Gcc-patches mailing list