]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp: fix mistakes in fileSeek handler
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 16 Nov 2012 11:06:46 +0000 (11:06 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 16 Nov 2012 11:06:46 +0000 (11:06 +0000)
src/htsp_server.c

index 34f94d78c2b9f0ca9121d511bacdbbbe2edc556f..ef49a7c4522c2494d28b276bfa2b700d7cb02499 100644 (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();