summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/random-seed.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/random-seed.c b/src/random-seed.c
index 8eab2b4e1c..054233e660 100644
--- a/src/random-seed.c
+++ b/src/random-seed.c
@@ -86,9 +86,11 @@ int main(int argc, char *argv[]) {
}
}
- if ((r = loop_read(seed_fd, buf, buf_size, false)) <= 0)
- log_error("Failed to read seed file: %s", r < 0 ? strerror(errno) : "EOF");
- else {
+ if ((r = loop_read(seed_fd, buf, buf_size, false)) <= 0) {
+
+ if (r != 0)
+ log_error("Failed to read seed file: %m");
+ } else {
lseek(seed_fd, 0, SEEK_SET);
if ((r = loop_write(random_fd, buf, (size_t) r, false)) <= 0)