summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>2014-06-27 21:31:12 +0000
committerderaadt <>2014-06-27 21:31:12 +0000
commit9cae0e2516ac9a43fe6b1723d99d460c7621b989 (patch)
tree722fd510d162d02651de1cecfc69f7d0c40ee073 /src/lib
parente59a02ca48a3a8740d1a32d7123f89e9645a9edd (diff)
downloadopenbsd-9cae0e2516ac9a43fe6b1723d99d460c7621b989.tar.gz
openbsd-9cae0e2516ac9a43fe6b1723d99d460c7621b989.tar.bz2
openbsd-9cae0e2516ac9a43fe6b1723d99d460c7621b989.zip
re-init and init code paths are now more shared, so the getpid()-based
portable code path must handle that; with brent cook
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/crypt/arc4random.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c
index ee47b2df34..fd8570565e 100644
--- a/src/lib/libc/crypt/arc4random.c
+++ b/src/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random.c,v 1.38 2014/06/26 19:23:15 deraadt Exp $ */ 1/* $OpenBSD: arc4random.c,v 1.39 2014/06/27 21:31:12 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -120,7 +120,8 @@ _rs_stir_if_needed(size_t len)
120 /* If a system lacks MAP_INHERIT_ZERO, resort to getpid() */ 120 /* If a system lacks MAP_INHERIT_ZERO, resort to getpid() */
121 if (_rs_pid == 0 || _rs_pid != pid) { 121 if (_rs_pid == 0 || _rs_pid != pid) {
122 _rs_pid = pid; 122 _rs_pid = pid;
123 rs->rs_count = 0; 123 if (rs)
124 rs->rs_count = 0;
124 } 125 }
125#endif 126#endif
126 if (!rs || rs->rs_count <= len) 127 if (!rs || rs->rs_count <= len)