diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:34:50 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-14 19:34:50 +0300 |
commit | 44311f4235463a8d4d3c4128242bbd7c9d2a203b (patch) | |
tree | 61cf649234696840338a76e6c83a8d5b8f45460f /src/statfile.c | |
parent | 4499fc92189905fde71139822d784ab7819b181c (diff) | |
download | rspamd-44311f4235463a8d4d3c4128242bbd7c9d2a203b.tar.gz rspamd-44311f4235463a8d4d3c4128242bbd7c9d2a203b.zip |
Detect and use fallocate/posix_fallocate.
Diffstat (limited to 'src/statfile.c')
-rw-r--r-- | src/statfile.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/statfile.c b/src/statfile.c index d9d42d983..b5b06419e 100644 --- a/src/statfile.c +++ b/src/statfile.c @@ -465,6 +465,8 @@ statfile_pool_create (statfile_pool_t * pool, gchar *filename, size_t size) return -1; } + rspamd_fallocate (fd, 0, sizeof (header) + sizeof (section) + sizeof (block) * nblocks); + header.create_time = (guint64) time (NULL); if (write (fd, &header, sizeof (header)) == -1) { msg_info ("cannot write header to file %s, error %d, %s", filename, errno, strerror (errno)); |