aboutsummaryrefslogtreecommitdiff
path: root/openbsd-compat/arc4random.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/arc4random.h')
-rw-r--r--openbsd-compat/arc4random.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/arc4random.h b/openbsd-compat/arc4random.h
index af2d5c172a28..8f6842874b29 100644
--- a/openbsd-compat/arc4random.h
+++ b/openbsd-compat/arc4random.h
@@ -65,7 +65,7 @@ _rs_forkdetect(void)
static inline int
_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
{
-#if defined(MAP_ANON) && defined(MAP_PRIVATE)
+#if defined(HAVE_MMAP) && defined(MAP_ANON) && defined(MAP_PRIVATE)
if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
return (-1);
@@ -84,7 +84,7 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
*rsp = NULL;
return (-1);
}
-#endif
+#endif /* HAVE_MMAP et al */
_ARC4_ATFORK(_rs_forkhandler);
return (0);