diff options
author | brian <brian@FreeBSD.org> | 2000-08-31 00:45:24 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-08-31 00:45:24 +0000 |
commit | ed0f07d9dd6b385bdf4112d9942c821fb92d7695 (patch) | |
tree | 629247fbfa4cca36341d8ebb4d30af203311bdc1 /usr.sbin | |
parent | afc6787158045131a17b21bc5d97f5ab2e957025 (diff) | |
download | FreeBSD-src-ed0f07d9dd6b385bdf4112d9942c821fb92d7695.zip FreeBSD-src-ed0f07d9dd6b385bdf4112d9942c821fb92d7695.tar.gz |
Use arc4random() instead of random()
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/defs.c | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/defs.h | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c index 033ec14..92815cc 100644 --- a/usr.sbin/ppp/defs.c +++ b/usr.sbin/ppp/defs.c @@ -53,10 +53,11 @@ #define issep(c) ((c) == '\t' || (c) == ' ') +#if defined(__NetBSD__) || __FreeBSD__ < 3 void randinit() { -#if defined(__OpenBSD__) || __FreeBSD__ >= 3 +#if defined(__FreeBSD__) static int initdone; /* srandomdev() call is only required once */ if (!initdone) { @@ -67,6 +68,7 @@ randinit() srandom((time(NULL)^getpid())+random()); #endif } +#endif ssize_t fullread(int fd, void *v, size_t n) diff --git a/usr.sbin/ppp/defs.h b/usr.sbin/ppp/defs.h index d339b07..8fe68b2 100644 --- a/usr.sbin/ppp/defs.h +++ b/usr.sbin/ppp/defs.h @@ -102,7 +102,13 @@ #define ROUNDUP(x) ((x) ? (1 + (((x) - 1) | (sizeof(long) - 1))) : sizeof(long)) +#if defined(__NetBSD__) || __FreeBSD__ < 3 extern void randinit(void); +#else +#define random arc4random +#define randinit() +#endif + extern ssize_t fullread(int, void *, size_t); extern const char *mode2Nam(int); extern int Nam2mode(const char *); |