From: Adam Sutton Date: Fri, 22 Feb 2013 11:11:10 +0000 (+0000) Subject: timeshift: fix bug that can cause failure when seeking hits start of file X-Git-Tag: 3.4beta2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebc9c4a48d07c713961541c4b2db0f6b206ce14d;p=thirdparty%2Ftvheadend.git timeshift: fix bug that can cause failure when seeking hits start of file this resulted in a failed read that terminated the timeshift buffer. (cherry picked from commit 229a8d75d850a1dfd8694959e5e1114c5366f294) --- diff --git a/src/timeshift/timeshift_reader.c b/src/timeshift/timeshift_reader.c index e2d4437ef..1e9e54838 100644 --- a/src/timeshift/timeshift_reader.c +++ b/src/timeshift/timeshift_reader.c @@ -322,12 +322,10 @@ static int _timeshift_read #endif *fd = open((*cur_file)->path, O_RDONLY); } - if (*cur_off) { #ifdef TSHFT_TRACE - tvhlog(LOG_DEBUG, "timeshift", "ts %d seek to %lu", ts->id, *cur_off); + tvhlog(LOG_DEBUG, "timeshift", "ts %d seek to %lu", ts->id, *cur_off); #endif - lseek(*fd, *cur_off, SEEK_SET); - } + lseek(*fd, *cur_off, SEEK_SET); /* Read msg */ ssize_t r = _read_msg(*fd, sm);