summaryrefslogtreecommitdiff
path: root/src/random-seed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/random-seed.c')
-rw-r--r--src/random-seed.c6
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);
}