summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/haveged.83
-rw-r--r--src/haveged.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/man/haveged.8 b/man/haveged.8
index f88dc76..b1dc7cc 100644
--- a/man/haveged.8
+++ b/man/haveged.8
@@ -63,6 +63,9 @@ use "-" for stdout.
-F , --Foreground
Run daemon in foreground. Do not fork and detach.
.TP
+-e , --once
+Provide entropy to the kernel once and quit immediatelly.
+.TP
-i nnn, --inst=nnn
Set instruction cache size to nnn KB. Default is 16 or as determined dynamically.
.TP
diff --git a/src/haveged.c b/src/haveged.c
index fcfe764..293f5e6 100644
--- a/src/haveged.c
+++ b/src/haveged.c
@@ -657,8 +657,10 @@ static void run_daemon( /* RETURN: nothing */
if (ioctl(random_fd, RNDADDENTROPY, output) == -1)
error_exit("RNDADDENTROPY failed!");
h->n_entropy_bytes += nbytes;
- if (params->once == 1)
+ if (params->once == 1) {
+ params->exit_code = 0;
error_exit("Entropy refilled once (%d bytes), exiting.", nbytes);
+ }
t[0] = t[1];
continue;
}