Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
timeshift: correctly signal the end-of-data for RAM segment
  • Loading branch information
perexg committed Dec 13, 2015
1 parent e4e30e3 commit 2749e38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/timeshift/timeshift_reader.c
Expand Up @@ -44,6 +44,7 @@
static ssize_t _read_buf ( timeshift_file_t *tsf, int fd, void *buf, size_t size )
{
if (tsf && tsf->ram) {
if (tsf->roff == tsf->woff) return 0;
if (tsf->roff + size > tsf->woff) return -1;
pthread_mutex_lock(&tsf->ram_lock);
memcpy(buf, tsf->ram + tsf->roff, size);
Expand Down

2 comments on commit 2749e38

@ksooo
Copy link
Contributor

@ksooo ksooo commented on 2749e38 Dec 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please backport this to 4.0.x?

@ksooo
Copy link
Contributor

@ksooo ksooo commented on 2749e38 Dec 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, you already did :-)

Please sign in to comment.