rand/noise.c (noise_devrandom): Fix reading from the kernel random device.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 13 Jul 2013 15:34:40 +0000 (16:34 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 9 Mar 2014 01:04:52 +0000 (01:04 +0000)
commit57354275bd678ce002781f7a64204c9a45b1928c
tree22c6c6302c7bfb4aff182b33c2e019e6a9bf12f0
parent77fdf13a3806b30dd8c2caac23ce5c160904bac9
rand/noise.c (noise_devrandom): Fix reading from the kernel random device.

It was, unfortunately, filled with badgers.

  * Don't take short reads for an answer.  Loop until the read actually
    fails, or we've filled the buffer.

  * If we didn't actually read enough to fill the buffer, then don't
    return success!  The fallback collectors will engage and hopefully
    save our bacon.
rand/noise.c