Skip to content

Commit b937061

Browse files
committed
Check HAVE_MMAP too now that configure sets it.
1 parent 8d57083 commit b937061

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openbsd-compat/arc4random.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ _rs_forkdetect(void)
6565
static inline int
6666
_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
6767
{
68-
#if defined(MAP_ANON) && defined(MAP_PRIVATE)
68+
#if defined(HAVE_MMAP) && defined(MAP_ANON) && defined(MAP_PRIVATE)
6969
if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
7070
MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
7171
return (-1);
@@ -84,7 +84,7 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
8484
*rsp = NULL;
8585
return (-1);
8686
}
87-
#endif
87+
#endif /* HAVE_MMAP et al */
8888

8989
_ARC4_ATFORK(_rs_forkhandler);
9090
return (0);

0 commit comments

Comments
 (0)