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 <j...@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
pipe2.diff
Description: Binary data