summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mmap/unix/mmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mmap/unix/mmap.c b/mmap/unix/mmap.c
index 30e324564..95afb0754 100644
--- a/mmap/unix/mmap.c
+++ b/mmap/unix/mmap.c
@@ -176,6 +176,7 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new,
assert(psize > 0 && (psize & (psize - 1)) == 0);
}
poffset = offset & (apr_off_t)(psize - 1);
+ set_poffset(*new, poffset);
#endif
mm = mmap(NULL, size + poffset,
@@ -187,10 +188,11 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new,
*new = NULL;
return errno;
}
+
+ mm = (char *)mm + poffset;
#endif
- (*new)->mm = (char *)mm + poffset;
- set_poffset(*new, poffset);
+ (*new)->mm = mm;
(*new)->size = size;
(*new)->cntxt = cont;
APR_RING_ELEM_INIT(*new, link);