mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +02:00
* fports.c (local_seek): Signal an error if the seek fails.
* ports.c (scm_lseek): Don't check return value of port's seek function; it's its job to signal an error if there's a problem.
This commit is contained in:
parent
afc5764cd0
commit
cb8dfa3f67
2 changed files with 5 additions and 4 deletions
|
@ -435,8 +435,11 @@ static off_t
|
||||||
local_seek (SCM port, off_t offset, int whence)
|
local_seek (SCM port, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
struct scm_fport *fp = SCM_FSTREAM (port);
|
struct scm_fport *fp = SCM_FSTREAM (port);
|
||||||
|
off_t result = lseek (fp->fdes, offset, whence);
|
||||||
return lseek (fp->fdes, offset, whence);
|
|
||||||
|
if (result == -1)
|
||||||
|
scm_syserror ("local_seek");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -892,8 +892,6 @@ scm_lseek (SCM object, SCM offset, SCM whence)
|
||||||
ptob->fflush (object);
|
ptob->fflush (object);
|
||||||
|
|
||||||
rv = ptob->seek (object, off, how);
|
rv = ptob->seek (object, off, how);
|
||||||
if (rv == -1)
|
|
||||||
scm_syserror (s_lseek);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* file descriptor?. */
|
else /* file descriptor?. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue