summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2016-08-24 14:45:32 -0400
committerKeith Bostic <keith.bostic@mongodb.com>2016-08-24 14:45:32 -0400
commit78fbc074082a47c96a619d766c335483c2c15556 (patch)
treea6f2e759aea9ba8b0e66c600633b0ffb6018c9e2
parent539aae190ba82a705d8d466d3fd00907c3c291a3 (diff)
downloadmongo-78fbc074082a47c96a619d766c335483c2c15556.tar.gz
WT-2857 Check for ftruncate function. (#2977)
-rw-r--r--src/os_posix/os_fallocate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/os_posix/os_fallocate.c b/src/os_posix/os_fallocate.c
index 7395bf94a76..111f6558816 100644
--- a/src/os_posix/os_fallocate.c
+++ b/src/os_posix/os_fallocate.c
@@ -146,7 +146,8 @@ __wt_posix_file_extend(
* Use the POSIX ftruncate call if there's nothing else, it can extend
* files. Note ftruncate requires locking.
*/
- if (file_handle->fh_truncate(file_handle, wt_session, offset) == 0) {
+ if (file_handle->fh_truncate != NULL &&
+ file_handle->fh_truncate(file_handle, wt_session, offset) == 0) {
file_handle->fh_extend = file_handle->fh_truncate;
WT_WRITE_BARRIER();
return (0);