From: Andreas Ă–man Date: Thu, 15 Nov 2012 12:25:23 +0000 (+0100) Subject: HTSP: Use lseek() + read() instead of pread() X-Git-Tag: v3.5~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36d097232eb6131d2b7096950146e59b10327b43;p=thirdparty%2Ftvheadend.git HTSP: Use lseek() + read() instead of pread() Does not build out-of-the-box on lucid otherwise --- diff --git a/src/htsp_server.c b/src/htsp_server.c index f2db2617e..fa1376869 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -1345,11 +1345,14 @@ htsp_method_file_read(htsp_connection_t *htsp, htsmsg_t *in) if(hf == NULL) return htsp_error("Unknown file id"); + if(lseek(hf->hf_fd, off, SEEK_SET) != off) + return htsp_error("Seek error"); + void *m = malloc(size); if(m == NULL) return htsp_error("Too big segment"); - int r = pread(hf->hf_fd, m, size, off); + int r = read(hf->hf_fd, m, size); if(r < 0) { free(m); return htsp_error("Read error");