random-seed: provide nicer error message when unable to open file
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Feb 2016 00:45:08 +0000 (19:45 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 6 Feb 2016 23:13:41 +0000 (18:13 -0500)
commit8edc2d22d8727c533af72c674e538df140267d9e
treeb532804441822aa19231a23670df07502ce64d62
parent784b22eef5005309a43400e9ab43d37281b1290c
random-seed: provide nicer error message when unable to open file

If /var is read-only, and the seed file does not exist, we would print
a misleading error message for ENOENT. Print both messages instead, to
make it easy to diagonose.

Also, treat the cases of missing seed file the same as empty seed file
and exit successfully. Initialize the return code properly.

Fixes https://github.com/systemd/systemd/issues/2530,
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813599.
src/random-seed/random-seed.c