Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
09ad57ec
Commit
09ad57ec
authored
Jun 11, 2011
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return error when trying to seek a non-seekable buffered file
From-SVN: r174947
parent
5ea0705a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
libgfortran/ChangeLog
+5
-0
libgfortran/io/unix.c
+6
-1
No files found.
libgfortran/ChangeLog
View file @
09ad57ec
2011-06-11 Janne Blomqvist <jb@gcc.gnu.org>
2011-06-11 Janne Blomqvist <jb@gcc.gnu.org>
* io/unix.c (buf_seek): Return error if file is not seekable.
(buf_tell): Call buf_seek.
2011-06-11 Janne Blomqvist <jb@gcc.gnu.org>
* io/unix.c (fd_to_stream): Figure out if a fd is seekable by
* io/unix.c (fd_to_stream): Figure out if a fd is seekable by
trying lseek().
trying lseek().
...
...
libgfortran/io/unix.c
View file @
09ad57ec
...
@@ -560,6 +560,11 @@ buf_write (unix_stream * s, const void * buf, ssize_t nbyte)
...
@@ -560,6 +560,11 @@ buf_write (unix_stream * s, const void * buf, ssize_t nbyte)
static
gfc_offset
static
gfc_offset
buf_seek
(
unix_stream
*
s
,
gfc_offset
offset
,
int
whence
)
buf_seek
(
unix_stream
*
s
,
gfc_offset
offset
,
int
whence
)
{
{
if
(
s
->
file_length
==
-
1
)
{
errno
=
ESPIPE
;
return
-
1
;
}
switch
(
whence
)
switch
(
whence
)
{
{
case
SEEK_SET
:
case
SEEK_SET
:
...
@@ -585,7 +590,7 @@ buf_seek (unix_stream * s, gfc_offset offset, int whence)
...
@@ -585,7 +590,7 @@ buf_seek (unix_stream * s, gfc_offset offset, int whence)
static
gfc_offset
static
gfc_offset
buf_tell
(
unix_stream
*
s
)
buf_tell
(
unix_stream
*
s
)
{
{
return
s
->
logical_offset
;
return
buf_seek
(
s
,
0
,
SEEK_CUR
)
;
}
}
static
int
static
int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment