Use arc4random() instead of random()
This commit is contained in:
parent
3e755f76d1
commit
8507c35e67
@ -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)
|
||||
|
@ -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 *);
|
||||
|
Loading…
x
Reference in New Issue
Block a user