diff options
-rw-r--r-- | Modules/mmapmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index f58e0f1..dd7c16f 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -421,12 +421,12 @@ mmap_resize_method(mmap_object *self, return NULL; #else } else { + void *newmap; + if (ftruncate(self->fd, new_size) == -1) { PyErr_SetFromErrno(mmap_module_error); return NULL; } - - void *newmap; #ifdef MREMAP_MAYMOVE newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE); |