Skip to content

Commit a981ad3

Browse files
authored
Merge pull request #670 from eynhaender/master
Replace ftruncate with fallocate
2 parents 0a23784 + 0836cbe commit a981ad3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/memory/map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ bool map::remap_(size_t size) NOEXCEPT
558558
bool map::resize_(size_t size) NOEXCEPT
559559
{
560560
// Disk full detection is platform common, any other failure is an abort.
561-
if (::ftruncate(opened_, size) == fail)
561+
if (::fallocate(opened_, 0, capacity_, size - capacity_) == fail)
562562
{
563563
// Disk full is the only restartable store failure (leave mapped).
564564
if (errno == ENOSPC)

0 commit comments

Comments
 (0)