HTSP: Use lseek() + read() instead of pread()
Does not build out-of-the-box on lucid otherwise
This commit is contained in:
parent
890acb780c
commit
36d097232e
1 changed files with 4 additions and 1 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue