mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-21 07:45:04 +02:00
Update arc4random() headers from OpenBSD
Split Linux support into its own header separate from the generic Unix to fix a Linux-specific issue with clone(). Reset rsp to NULL on failure.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: arc4random_linux.h,v 1.8 2014/08/13 06:04:10 deraadt Exp $ */
|
||||
/* $OpenBSD: arc4random_freebsd.h,v 1.4 2016/06/30 12:19:51 bcook Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, David Mazieres <dm@uun.org>
|
||||
@@ -84,6 +84,7 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
|
||||
if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
|
||||
MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
|
||||
munmap(*rsp, sizeof(**rsp));
|
||||
*rsp = NULL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user