diff options
| author | Roy Marples <roy@marples.name> | 2008-05-15 19:21:15 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-05-15 19:21:15 +0000 |
| commit | dcf889cb72d2d385db03e3ee29b80fbf035abf69 (patch) | |
| tree | 9218e6b04960855efce69f39b7abe2921de7b014 /common.c | |
| parent | 8673924690579224982640dd29cbbbdfd3721bcd (diff) | |
| download | dhcpcd-dcf889cb72d2d385db03e3ee29b80fbf035abf69.tar.xz | |
Use arc4random as everything apart from glibc seems to have it.
Diffstat (limited to 'common.c')
| -rw-r--r-- | common.c | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -36,7 +36,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <time.h> #include <unistd.h> #include "common.h" @@ -75,25 +74,6 @@ get_line(char **line, size_t *len, FILE *fp) return last; } -/* OK, this should be in dhcpcd.c - * It's here to make dhcpcd more readable */ -#if HAVE_SRANDOMDEV -#else -void srandomdev(void) -{ - int fd; - unsigned long seed; - - fd = open("/dev/urandom", 0); - if (fd == -1 || read(fd, &seed, sizeof(seed)) == -1) - seed = time(0); - if (fd >= 0) - close(fd); - - srandom(seed); -} -#endif - /* strlcpy is nice, shame glibc does not define it */ #if HAVE_STRLCPY #else |
