summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-19 09:16:55 +0000
committerRoy Marples <roy@marples.name>2008-05-19 09:16:55 +0000
commit32391c95110f44cd7dd0245221c21b7e0d7e5d5a (patch)
tree64329bbd21d08e82b82cac5ddcf6fce2ebc5e422 /common.h
parentc30da3c20325f4ddbf797bc5f30e5e422b185b6e (diff)
downloaddhcpcd-32391c95110f44cd7dd0245221c21b7e0d7e5d5a.tar.xz
Create a real arc4linux function so we don't have to visible seed random in dhcpcd main.
Diffstat (limited to 'common.h')
-rw-r--r--common.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/common.h b/common.h
index 41918467..9df668a8 100644
--- a/common.h
+++ b/common.h
@@ -29,9 +29,9 @@
#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 <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -41,8 +41,12 @@
# define _unused
#endif
-#ifdef __GLIBC__
-#define arc4random (uint32_t)random
+#ifndef HAVE_ARC4RANDOM
+# ifdef __GLIBC__
+uint32_t arc4random(void);
+#else
+# define HAVE_ARC4RANDOM
+# endif
#endif
#ifndef HAVE_STRLCPY