This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Only export arc4random_stir and arc4random_addrandom on Cygwin


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8e2b2adb3d0c97c663cf776b28a1f57ffb7fceef

commit 8e2b2adb3d0c97c663cf776b28a1f57ffb7fceef
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Mar 18 21:12:12 2016 +0100

    Only export arc4random_stir and arc4random_addrandom on Cygwin
    
    	Export to maintain backward compatibility, but don't let
    	them do anything useful.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/stdlib/arc4random.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/newlib/libc/stdlib/arc4random.c b/newlib/libc/stdlib/arc4random.c
index 146e176..0eeaa2c 100644
--- a/newlib/libc/stdlib/arc4random.c
+++ b/newlib/libc/stdlib/arc4random.c
@@ -194,20 +194,17 @@ arc4random_buf(void *buf, size_t n)
 	_ARC4_UNLOCK();
 }
 
+#ifdef __CYGWIN__
+/* Exported functions removed from OpenBSD in the meantime.  Keep them,
+   but make them non-functional.  They don't return a value anyway. */
 void
 arc4random_stir(void)
 {
-        _ARC4_LOCK();
-	_rs_stir();
-	_ARC4_UNLOCK();
 }
 
 void
 arc4random_addrandom(u_char *dat, int datlen)
 {
-	_ARC4_LOCK();
-	if (!rs)
-		_rs_stir();
-	_rs_rekey(dat, datlen);
-	_ARC4_UNLOCK();
 }
+
+#endif /* __CYGWIN__ */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]