diff options
author | Jirka Hladky <jhladky@redhat.com> | 2022-01-02 01:14:27 +0100 |
---|---|---|
committer | Jirka Hladky <jhladky@redhat.com> | 2022-01-02 01:14:27 +0100 |
commit | 9e4a1f53cfbb2a7aa1f534861e6f03587e5d6f16 (patch) | |
tree | 07cedb4fefbac6e8effde7e554c29d8c70b42ce1 | |
parent | Added haveged-once.service to provide entropy once (intended for initramfs) (diff) | |
download | haveged-9e4a1f53cfbb2a7aa1f534861e6f03587e5d6f16.tar.xz haveged-9e4a1f53cfbb2a7aa1f534861e6f03587e5d6f16.zip |
Fixed exist status when using --once option. Updated man page
-rw-r--r-- | man/haveged.8 | 3 | ||||
-rw-r--r-- | src/haveged.c | 4 |
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; } |