iscsi: only define srandomdev when arc4random not available
srandomdev is *only* used to emulate arc4random, so only bother defining it on Linux when it's needed. This avoids unused errors on newer distros packaging glibc versions that now defined arc4random. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I6e64a697d9633709cedd0198f75cf094d514562d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15814 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
2be0335489
commit
af8d147328
@ -32,10 +32,6 @@
|
||||
|
||||
#define MAX_TMPBUF 1024
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define HAVE_SRANDOMDEV 1
|
||||
#endif
|
||||
|
||||
struct spdk_iscsi_globals g_iscsi = {
|
||||
.mutex = PTHREAD_MUTEX_INITIALIZER,
|
||||
.portal_head = TAILQ_HEAD_INITIALIZER(g_iscsi.portal_head),
|
||||
@ -53,7 +49,7 @@ struct spdk_iscsi_globals g_iscsi = {
|
||||
| (((uint32_t) *((uint8_t *)(BUF)+3)) << 24)) \
|
||||
== (CRC32C))
|
||||
|
||||
#ifndef HAVE_SRANDOMDEV
|
||||
#ifndef SPDK_CONFIG_HAVE_ARC4RANDOM
|
||||
static void
|
||||
srandomdev(void)
|
||||
{
|
||||
@ -66,9 +62,7 @@ srandomdev(void)
|
||||
seed = pid ^ now;
|
||||
srandom(seed);
|
||||
}
|
||||
#endif /* HAVE_SRANDOMDEV */
|
||||
|
||||
#ifndef SPDK_CONFIG_HAVE_ARC4RANDOM
|
||||
static int g_arc4random_initialized = 0;
|
||||
|
||||
static uint32_t
|
||||
|
Loading…
Reference in New Issue
Block a user