chiark / gitweb /
Works at least without crypto.
[userv-utils.git] / ipif / utils.c
index c215390af059863d29c5eae4bdf2a61ff3067720..97ff4309359e15f5860c8fad2043ed526bc4a53e 100644 (file)
@@ -81,22 +81,6 @@ void read_must(int fd, void *p_in, int sz, const char *what) {
   }
 }
 
-void get_random(void *ptr, size_t sz) {
-  static FILE *randfile;
-
-  size_t r;
-
-  if (!randfile) {
-    randfile= fopen("/dev/urandom","rb");
-    if (!randfile && errno==ENOENT) randfile= fopen("/dev/random","rb");
-    if (!randfile) sysfail("open random number generator");
-  }
-
-  r= fread(ptr,1,sz,randfile);
-  if (r == sz) return;
-  (ferror(randfile) ? sysfail : fail)("cannot read random number generator");
-}
-
 const char *getarg_string(void) {
   const char *arg;