HTSP: Use lseek() + read() instead of pread()

Does not build out-of-the-box on lucid otherwise
This commit is contained in:
Andreas Öman 2012-11-15 13:25:23 +01:00
parent 890acb780c
commit 36d097232e

View file

@ -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");