summaryrefslogtreecommitdiff
path: root/libguile/filesys.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-03-25 13:28:42 +0100
committerLudovic Courtès <ludo@gnu.org>2013-03-25 13:28:42 +0100
commitf28885f4957882c4d96bdfee11d26cd265539aac (patch)
tree619a20cc6387d33707cdef440152d699a3f5fc2e /libguile/filesys.c
parent45417ab1066b3f7f65ff4ff4f6ca2733c75bd521 (diff)
downloadguile-f28885f4957882c4d96bdfee11d26cd265539aac.tar.gz
sendfile: Check return value of `lseek'.
* libguile/filesys.c (scm_sendfile): Check return value of `lseek_or_lseek64', and use `SCM_SYSERROR' upon error.
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r--libguile/filesys.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 6804db9fb..334e2cd07 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1157,7 +1157,10 @@ SCM_DEFINE (scm_sendfile, "sendfile", 3, 1, 0,
if (SCM_PORTP (in))
scm_seek (in, offset, scm_from_int (SEEK_SET));
else
- lseek_or_lseek64 (in_fd, c_offset, SEEK_SET);
+ {
+ if (lseek_or_lseek64 (in_fd, c_offset, SEEK_SET) < 0)
+ SCM_SYSERROR;
+ }
}
for (result = 0, left = c_count; result < c_count; )