]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: show lseek error
authorJaroslav Kysela <perex@perex.cz>
Sat, 6 Jan 2018 10:08:31 +0000 (11:08 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 6 Jan 2018 10:08:31 +0000 (11:08 +0100)
src/webui/webui.c

index a2f8f9c7ec0801faef3d0ca2d027ef4a4fda9cfa..5c212186f1cccfcfb2d95d42d3d3d483ca36664c 100644 (file)
@@ -1521,11 +1521,15 @@ http_serve_file(http_connection_t *hc, const char *fname,
   sprintf(range_buf, "bytes %jd-%jd/%jd",
           file_start, file_end, (intmax_t)st.st_size);
 
-  if(file_start > 0)
-    if (lseek(fd, file_start, SEEK_SET) != file_start) {
+  if(file_start > 0) {
+    off_t off;
+    if ((off = lseek(fd, file_start, SEEK_SET)) != file_start) {
+      tvherror(LS_HTTP, "unable to seek (offset %jd, returned %jd): %s",
+               file_start, (intmax_t)off, strerror(errno));
       close(fd);
       return HTTP_STATUS_INTERNAL;
     }
+  }
 
   if (preop) {
     ret = preop(hc, file_start, content_len, opaque);