summaryrefslogtreecommitdiff
path: root/lib/libevent/select.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2013-08-24 10:46:49 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2013-08-24 10:46:49 +0000
commit8cacaa9a558698840b06432b2090a55a1cad33e2 (patch)
treeb5bd5ad3e38e1efcd4e2c869a4788242097fa8b7 /lib/libevent/select.c
parent24836064cc12af4a07914cb17c9edd7c16461c3a (diff)
replace random() with arc4random.
blambert didnt like stuff linking to libevent getting warnings about use of an unsafe api. ok blambert@ mikeb@ deraadt@ millert@
Diffstat (limited to 'lib/libevent/select.c')
-rw-r--r--lib/libevent/select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libevent/select.c b/lib/libevent/select.c
index 4e0c2b2a2b2..b87dcf929dd 100644
--- a/lib/libevent/select.c
+++ b/lib/libevent/select.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: select.c,v 1.16 2010/04/21 21:02:47 nicm Exp $ */
+/* $OpenBSD: select.c,v 1.17 2013/08/24 10:46:48 dlg Exp $ */
/*
* Copyright 2000-2002 Niels Provos <provos@citi.umich.edu>
@@ -175,7 +175,7 @@ select_dispatch(struct event_base *base, void *arg, struct timeval *tv)
event_debug(("%s: select reports %d", __func__, res));
check_selectop(sop);
- i = random() % (sop->event_fds+1);
+ i = arc4random_uniform(sop->event_fds + 1);
for (j = 0; j <= sop->event_fds; ++j) {
struct event *r_ev = NULL, *w_ev = NULL;
if (++i >= sop->event_fds+1)