1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

fport_seek: Eliminate a fruitless use of 'off_t_or_off64_t'.

This is a followup to commit 91ba73b397.

* libguile/fports.c (fport_seek): Use 'lseek' instead of
'lseek_or_lseek64', and use 'scm_t_off' uniformly.  That's the type used
in the function signature, and there's no benefit to using a wider type
internally.  Remove the overflow check, which is no longer needed.
This commit is contained in:
Mark H Weaver 2019-06-18 03:28:18 -04:00
parent 2095033b42
commit a17b727963

View file

@ -613,18 +613,13 @@ static scm_t_off
fport_seek (SCM port, scm_t_off offset, int whence)
{
scm_t_fport *fp = SCM_FSTREAM (port);
off_t_or_off64_t result;
scm_t_off result;
result = lseek_or_lseek64 (fp->fdes, offset, whence);
result = lseek (fp->fdes, offset, whence);
if (result == -1)
scm_syserror ("fport_seek");
/* Check to make sure the result fits in scm_t_off,
which might be smaller than off_t_or_off64_t. */
if (result > SCM_T_OFF_MAX)
scm_num_overflow ("fport_seek");
return result;
}