Skip to content

Commit

Permalink
timeshift: fix bug that can cause failure when seeking hits start of …
Browse files Browse the repository at this point in the history
…file

this resulted in a failed read that terminated the timeshift buffer.
(cherry picked from commit 229a8d7)
  • Loading branch information
adamsutton committed Feb 22, 2013
1 parent f4dda1b commit ebc9c4a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/timeshift/timeshift_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ebc9c4a

Please sign in to comment.