diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-03-25 13:28:42 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-03-25 13:28:42 +0100 |
commit | f28885f4957882c4d96bdfee11d26cd265539aac (patch) | |
tree | 619a20cc6387d33707cdef440152d699a3f5fc2e /libguile/filesys.c | |
parent | 45417ab1066b3f7f65ff4ff4f6ca2733c75bd521 (diff) | |
download | guile-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.c | 5 |
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; ) |