Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- use atomic_dec_u64 for decrementing size counters - this prevents a…
…n unsigned wrap because of casting negative parameter to uint64_t - fixes #2712
  • Loading branch information
Memphiz authored and perexg committed May 14, 2015
1 parent 8316608 commit c74d73c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/timeshift/timeshift_filemgr.c
Expand Up @@ -180,9 +180,9 @@ void timeshift_filemgr_remove
tvhdebug("timeshift", "ts %d RAM segment remove time %li", ts->id, (long)tsf->time);
#endif
TAILQ_REMOVE(&ts->files, tsf, link);
atomic_add_u64(&timeshift_total_size, -tsf->size);
atomic_dec_u64(&timeshift_total_size, tsf->size);
if (tsf->ram)
atomic_add_u64(&timeshift_total_ram_size, -tsf->size);
atomic_dec_u64(&timeshift_total_ram_size, tsf->size);
timeshift_reaper_remove(tsf);
}

Expand Down

0 comments on commit c74d73c

Please sign in to comment.