diff --git a/libguile/fports.c b/libguile/fports.c index bc1e516e3..35084a2f9 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -435,8 +435,11 @@ static off_t local_seek (SCM port, off_t offset, int whence) { struct scm_fport *fp = SCM_FSTREAM (port); - - return lseek (fp->fdes, offset, whence); + off_t result = lseek (fp->fdes, offset, whence); + + if (result == -1) + scm_syserror ("local_seek"); + return result; } static void diff --git a/libguile/ports.c b/libguile/ports.c index 306eaacf2..1272fd608 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -892,8 +892,6 @@ scm_lseek (SCM object, SCM offset, SCM whence) ptob->fflush (object); rv = ptob->seek (object, off, how); - if (rv == -1) - scm_syserror (s_lseek); } } else /* file descriptor?. */