diff --git a/src/httpd.c b/src/httpd.c index cedce0a6..482288b8 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -321,6 +321,7 @@ httpd_stream_file(struct evhttp_request *req, int id) char buf[64]; int64_t offset; int64_t end_offset; + off_t pos; int transcode; int ret; @@ -447,8 +448,8 @@ httpd_stream_file(struct evhttp_request *req, int id) } st->size = sb.st_size; - ret = lseek(st->fd, offset, SEEK_SET); - if (ret < 0) + pos = lseek(st->fd, offset, SEEK_SET); + if (pos == (off_t) -1) { DPRINTF(E_LOG, L_HTTPD, "Could not seek into %s: %s\n", mfi->path, strerror(errno)); diff --git a/src/transcode.c b/src/transcode.c index f43a65f5..d80236f7 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -313,6 +313,7 @@ struct transcode_ctx * transcode_setup(struct media_file_info *mfi, off_t *est_size) { struct transcode_ctx *ctx; + off_t pos; int hdr_len; int i; int ret; @@ -428,8 +429,8 @@ transcode_setup(struct media_file_info *mfi, off_t *est_size) else hdr_len = 0; - ret = lseek(ctx->fd, hdr_len, SEEK_SET); - if (ret < 0) + pos = lseek(ctx->fd, hdr_len, SEEK_SET); + if (pos == (off_t) -1) { DPRINTF(E_WARN, L_XCODE, "Could not seek: %s\n", strerror(errno));