htsp: fix mistakes in fileSeek handler

This commit is contained in:
Adam Sutton 2012-11-16 11:06:46 +00:00
parent 7943c8b684
commit 249b4c1d0f

View file

@ -1449,10 +1449,10 @@ htsp_method_file_seek(htsp_connection_t *htsp, htsmsg_t *in)
else
return htsp_error("Field 'whence' contained invalid value");
} else {
whence = SEEK_CUR;
whence = SEEK_SET;
}
if(lseek(hf->hf_fd, off, whence) != off)
if ((off = lseek(hf->hf_fd, off, whence)) < 0)
return htsp_error("Seek error");
rep = htsmsg_create_map();