mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
logger: fix overflow on SD card total bytes
This commit is contained in:
committed by
Lorenz Meier
parent
c7cb62eb28
commit
700b2c6294
@@ -2117,7 +2117,7 @@ int Logger::check_free_space()
|
||||
|
||||
|
||||
uint64_t min_free_bytes = 300ULL * 1024ULL * 1024ULL;
|
||||
uint64_t total_bytes = statfs_buf.f_blocks * statfs_buf.f_bsize;
|
||||
uint64_t total_bytes = (uint64_t)statfs_buf.f_blocks * statfs_buf.f_bsize;
|
||||
|
||||
if (total_bytes / 10 < min_free_bytes) { // reduce the minimum if it's larger than 10% of the disk size
|
||||
min_free_bytes = total_bytes / 10;
|
||||
|
||||
Reference in New Issue
Block a user