Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: nmathewson/Libevent
...
head fork: ghazel/Libevent
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 3 commit comments
  • 1 contributor
Showing with 9 additions and 4 deletions.
  1. +9 −4 evutil_rand.c
View
13 evutil_rand.c
@@ -65,10 +65,16 @@ evutil_free_secure_rng_globals_locks(void)
static void
ev_arc4random_buf(void *buf, size_t n)
{
-#ifdef EVENT__HAVE_ARC4RANDOM_BUF
- return arc4random_buf(buf, n);
-#else
unsigned char *b = buf;
+#ifdef _EVENT_HAVE_ARC4RANDOM_BUF
+#ifdef __APPLE__
+ if (arc4random_buf) {
+ return arc4random_buf(buf, n);
+ }
+#else /* !__APPLE__ */
+ return arc4random_buf(buf, n);
+#endif
+#endif
/* Make sure that we start out with b at a 4-byte alignment; plenty
* of CPUs care about this for 32-bit access. */
if (n >= 4 && ((ev_uintptr_t)b) & 3) {
@@ -87,7 +93,6 @@ ev_arc4random_buf(void *buf, size_t n)
ev_uint32_t u = arc4random();
memcpy(b, &u, n);
}
-#endif
}
#else /* !EVENT__HAVE_ARC4RANDOM { */

Showing you all comments on commits in this comparison.

@nmathewson
Owner

I've tweaked it a little to add a comment and try to make it build without warnings when we have arc4random_buf() but we are not on OSX. How does my branch "20_arc4rand_buf" look to you?

@ghazel

Looks great!

@nmathewson
Owner

great; squashed and merged. Thanks!

Something went wrong with that request. Please try again.