diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-11-08 19:44:16 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-11-08 19:44:16 +0100 |
commit | 1e2579fdeb7608719cb28da0b5061f48ba0efc34 (patch) | |
tree | 83352697294bd24015efdce199e8fbc3d2788f6e /src/random-seed.c | |
parent | a40593a0d0d740efa387e35411e1e456a6c5aba7 (diff) | |
parent | 4cbd9ecf45f64c3a9acc99d473fbf3be3687ae24 (diff) |
Merge branch 'master' into journal
Diffstat (limited to 'src/random-seed.c')
-rw-r--r-- | src/random-seed.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/random-seed.c b/src/random-seed.c index ee5cae315c..0c63794b66 100644 --- a/src/random-seed.c +++ b/src/random-seed.c @@ -51,7 +51,11 @@ int main(int argc, char *argv[]) { /* Read pool size, if possible */ if ((f = fopen("/proc/sys/kernel/random/poolsize", "re"))) { - fscanf(f, "%zu", &buf_size); + if (fscanf(f, "%zu", &buf_size) > 0) { + /* poolsize is in bits on 2.6, but we want bytes */ + buf_size /= 8; + } + fclose(f); } |