]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
- use atomic_dec_u64 for decrementing size counters - this prevents an unsigned wrap...
authorMemphis <memphis@machzwo.de>
Wed, 13 May 2015 18:35:29 +0000 (20:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 May 2015 06:48:36 +0000 (08:48 +0200)
src/timeshift/timeshift_filemgr.c

index 04c6ea0a78f03f162fc2ec919ccb6253bf7c05db..de4e21f45e8ca0a085beb97e6e2027bb794a23b4 100644 (file)
@@ -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);
 }