[patch, libgfortran] PR30162 Named pipe formatted I/O
Jerry DeLisle
jvdelisle@verizon.net
Fri Jan 5 04:59:00 GMT 2007
:ADDPATCH fortran:
This is a first installment of fixes for this bug. The attached patch allows
formatted I/O to named pipes by avoiding attempts to seek when the file is
unseekable. It is fairly self explanatory.
Regression tested on x86-64-Linux-gnu. I am not clear on how to test this
within the test suite machinery. I have attached two test cases. Run one in
the background, then run the other. You must first create the FIFO with 'mkfifo np'
OK for trunk and then 4.2
Regards,
Jerry
2007-01-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/30162
* io/unix.c (fd_flush): Don't seek if file is not seekable, defined as
s->file_length == -1.
(fd_alloc_w_at): Do not adjust file_length if file is not seekable.
(fd_seek): If not seekable, just return success.
(fd_truncate): If not seekable, no need to truncate. Return failure if
seek fails and the stream is not a pipe.
(fd_to_stream): Make test for non-seekable file more robust.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30162-b.diff
Type: text/x-patch
Size: 3318 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070105/2a9f1229/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read.f
Type: text/x-fortran
Size: 205 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070105/2a9f1229/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: write.f
Type: text/x-fortran
Size: 179 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070105/2a9f1229/attachment-0002.bin>
More information about the Fortran
mailing list