summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-15 19:21:15 +0000
committerRoy Marples <roy@marples.name>2008-05-15 19:21:15 +0000
commitdcf889cb72d2d385db03e3ee29b80fbf035abf69 (patch)
tree9218e6b04960855efce69f39b7abe2921de7b014 /common.h
parent8673924690579224982640dd29cbbbdfd3721bcd (diff)
downloaddhcpcd-dcf889cb72d2d385db03e3ee29b80fbf035abf69.tar.xz
Use arc4random as everything apart from glibc seems to have it.
Diffstat (limited to 'common.h')
-rw-r--r--common.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/common.h b/common.h
index f1105321..41918467 100644
--- a/common.h
+++ b/common.h
@@ -29,6 +29,7 @@
#define COMMON_H
/* string.h pulls in features.h so the below define checks work */
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
@@ -40,6 +41,10 @@
# define _unused
#endif
+#ifdef __GLIBC__
+#define arc4random (uint32_t)random
+#endif
+
#ifndef HAVE_STRLCPY
# define HAVE_STRLCPY 1
#endif
@@ -51,14 +56,6 @@ size_t strlcpy(char *, const char *, size_t);
# endif
#endif
-#ifndef HAVE_SRANDOMDEV
-# define HAVE_SRANDOMDEV 1
-#endif
-#if defined(__GLIBC__) || defined(__NetBSD__)
-# undef HAVE_SRANDOMDEV
-void srandomdev(void);
-#endif
-
#ifndef HAVE_CLOSEFROM
#define HAVE_CLOSEFROM 1
#endif