From: Jaroslav Kysela Date: Sat, 6 Jan 2018 10:08:31 +0000 (+0100) Subject: webui: show lseek error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb22b9565a02362c2d1570105d2e9080f4aa6a08;p=thirdparty%2Ftvheadend.git webui: show lseek error --- diff --git a/src/webui/webui.c b/src/webui/webui.c index a2f8f9c7e..5c212186f 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -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);