util.random: Open /dev/urandom read-only, make seed() a noop
authorKim Alvefur <zash@zash.se>
Tue, 12 Jan 2016 22:48:16 +0000 (23:48 +0100)
committerKim Alvefur <zash@zash.se>
Tue, 12 Jan 2016 22:48:16 +0000 (23:48 +0100)
util/random.lua

index 4963e98c5645268f196c3d98858e1ccc5a7cc8bd..05f36aba326d661fd93182d3875e13520e1b01c9 100644 (file)
@@ -6,11 +6,9 @@
 -- COPYING file in the source package for more information.
 --
 
-local urandom = assert(io.open("/dev/urandom", "r+"));
+local urandom = assert(io.open("/dev/urandom", "r"));
 
-local function seed(x)
-       urandom:write(x);
-       urandom:flush();
+local function seed()
 end
 
 local function bytes(n)