diff options
author | Yunchih Chen <yunchih.cat@gmail.com> | 2017-12-06 00:11:48 +0800 |
---|---|---|
committer | Yunchih Chen <yunchih.cat@gmail.com> | 2017-12-06 00:11:48 +0800 |
commit | ec34224945af83be6244fb7c075b51a514806367 (patch) | |
tree | 9d528874cf998ecb161c387d03a236a941b6ec23 | |
parent | 973b9284c32ed3280275459184ed6bf161b4bbd7 (diff) | |
download | nfcollect-ec34224945af83be6244fb7c075b51a514806367.tar.gz nfcollect-ec34224945af83be6244fb7c075b51a514806367.tar.zst nfcollect-ec34224945af83be6244fb7c075b51a514806367.zip |
Fix wrong trunk_size
-rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -120,7 +120,8 @@ int main(int argc, char *argv[]) { ERR(signal(SIGHUP, sig_handler) == SIG_ERR, "Could not set SIGHUP handler"); uint32_t pgsize = getpagesize(); - uint32_t trunk_size_byte = (storage_size * 1024 * 1024) / TRUNK_SIZE ; // MiB + storage_size *= 1024 * 1024; // MiB + uint32_t trunk_size_byte = storage_size / TRUNK_SIZE ; trunk_size_byte = (trunk_size_byte < TRUNK_SIZE) ? TRUNK_SIZE : trunk_size_byte; trunk_size_byte = (trunk_size_byte / pgsize) * pgsize; // align with pagesize |