From 249b4c1d0f077ef70fd59c0d7e6b8a6aa33ab213 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 16 Nov 2012 11:06:46 +0000 Subject: [PATCH] htsp: fix mistakes in fileSeek handler --- src/htsp_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/htsp_server.c b/src/htsp_server.c index 34f94d78..ef49a7c4 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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();