aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-03-10 03:15:36 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-03-10 03:15:36 +0000
commit99c6db71de9460b2dac78b31e91ca279f6a50865 (patch)
tree5d99f9aecf1933262d78a6b92507191c382b4017 /libgfortran/io/unix.c
parentd1781ab0f5ec5929a1f2eef0a3b4ae6fdb0bf2e3 (diff)
downloadgcc-99c6db71de9460b2dac78b31e91ca279f6a50865.zip
gcc-99c6db71de9460b2dac78b31e91ca279f6a50865.tar.gz
gcc-99c6db71de9460b2dac78b31e91ca279f6a50865.tar.bz2
re PR libfortran/26499 (gfortran - End of File incorrectly positioned after binary I/O.)
2006-03-09 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/26499 * io/file_pos (st_rewind): Flush always. * io/unix.c (fd_truncate): Return SUCCESS rather than FAILURE for special files like /dev/null. * io/transfer.c (st_write_done): Remove broken logic that prevented calling fd_truncate. From-SVN: r111924
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 1293b24..550ddab 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -586,7 +586,7 @@ fd_truncate (unix_stream * s)
/* non-seekable files, like terminals and fifo's fail the lseek.
Using ftruncate on a seekable special file (like /dev/null)
- is undefined, so we treat it as if the ftruncate failed.
+ is undefined, so we treat it as if the ftruncate succeeded.
*/
#ifdef HAVE_FTRUNCATE
if (s->special_file || ftruncate (s->fd, s->logical_offset))
@@ -597,7 +597,7 @@ fd_truncate (unix_stream * s)
#endif
{
s->physical_offset = s->file_length = 0;
- return FAILURE;
+ return SUCCESS;
}
s->physical_offset = s->file_length = s->logical_offset;