From cb8dfa3f672aad59d34a738517c2f2c1d9afdfc1 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 14 Jun 1999 16:29:48 +0000 Subject: [PATCH] * 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. --- libguile/fports.c | 7 +++++-- libguile/ports.c | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) 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?. */